getAnnotation(field, XmlElementRef.class);
if (xmlElementRef != null) {
return new QName(xmlElementRef.namespace(),
xmlElementRef.name());
}
XmlElement xmlElement = (XmlElement)
getAnnotation(field, XmlElement.class);
// If XmlElement does not exist, default to using the field name
if (xmlElement == null ||
xmlElement.name().equals("##default")) {
return new QName("", field.getName());
}
return new QName(xmlElement.namespace(),
xmlElement.name());
}