JsonXMLRootProvider { protected QName getXmlTypeName(Class<?> type) { Method method = getXmlElementDeclMethod(type); if (method == null) { return null; } XmlElementDecl xmlElementDecl = method.getAnnotation(XmlElementDecl.class); if (xmlElementDecl == null) { return null; } XmlSchema xmlSchema = type.getPackage().getAnnotation(XmlSchema.class); String namespaceURI = getNamespaceURI(xmlElementDecl, xmlSchema); return new QName(namespaceURI, xmlElementDecl.name(), getPrefix(namespaceURI, xmlSchema)); }  QName getName(Class<?> type); JAXBElement<?> createElement(Class<?> type, Object value);  }
@Test public void testGetXmlTypeName() { JsonXMLRootProvider provider = new JsonXMLRootProvider(); Assert.assertNull(provider.getXmlTypeName(SampleRootElement.class)); Assert.assertNull(provider.getXmlTypeName(EmptyType.class)); Assert.assertEquals(new QName("sampleType"), provider.getXmlTypeName(SampleType.class)); Assert.assertEquals(new QName("urn:staxon:jaxb:test", "sampleTypeWithNamespace"), provider.getXmlTypeName(SampleTypeWithNamespace.class)); }