@Test
public void xmlTtoString() {
Document doc = XmlUtils.buildXml("root")
.addChild("child1")
.setAttribute("childAttr1", "val1")
.setAttribute("childAttr2", "val2")
.addText("Text1")
.endChild()
.addChild("child2")
.addChild("subChild1")
.addText("Text2")
.endChild()
.endChild()
.getDocument();
String simpleXml = XmlUtils.toString(doc, false, false);
TestUtils.assertEqualsResource("xmlToString_simpleXml.xml", simpleXml);
String fullXml = XmlUtils.toString(doc, true, true);
TestUtils.assertEqualsResource("xmlToString_fullXml.xml", fullXml);
}