XMLStreamSerializer serializer = new XMLStreamSerializer();
StringWriter sw = new StringWriter();
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
serializer.serialize(reader, writer);
String xml = sw.toString();
XMLAssert.assertXMLEqual(XML_RESULT, xml);
}
private static class XmlNodeImpl implements XmlNode {