document.appendChild(root);
Element a = document.createElement("a");
root.appendChild(a);
writer = new DomWriter(a, document, new XmlFriendlyNameCoder());
final XppDom xppRoot = new XppDom("root");
XppDom xppA = new XppDom("a");
xppRoot.addChild(xppA);
XppDom xppB = new XppDom("b");
xppA.addChild(xppB);
xppB.setAttribute("attr", "foo");
assertDocumentProducedIs(xppA, xppB);
XppDomWriter xppDomWriter = new XppDomWriter();
new HierarchicalStreamCopier().copy(createDocumentReaderFor(document.getDocumentElement()), xppDomWriter);
assertTrue(equals(xppRoot, xppDomWriter.getConfiguration()));