code: private <T extends Serializable> QName getXmlType(Class<T> clazz)
        throws IllegalArgumentException,
        IllegalAccessException,
        InvocationTargetException,
        SecurityException,
        NoSuchMethodException {
      Method getTypeDesc = clazz.getMethod("getTypeDesc");
      TypeDesc typeDesc = (TypeDesc) getTypeDesc.invoke(null);
      return typeDesc.getXmlType();
    }
docs: Uses reflection to get the QName XmlType.