// Serialize and consume. This should not cause expansion and currently won't update
// the name of the element.
StringWriter writer = new StringWriter();
XMLStreamWriter xmlwriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
root.serializeAndConsume(writer);
xmlwriter.flush();
String result = writer.toString();
assertTrue(element.getLocalName().equals("DUMMYNAME"));
assertTrue(element.getNamespace().getNamespaceURI().equals("http://DUMMYNS"));