StringWriter strWriter = new StringWriter();
MappedNamespaceConvention con = new MappedNamespaceConvention();
AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
w.writeStartDocument();
w.writeStartElement("root");
w.writeStartElement("subchild1");
w.writeStartElement("subchild2");
w.writeCharacters("first sub2");