@Test
public void testPrettyPrintingXml() throws Exception {

    String text = "<a><b><c>asdf</c><d/></b></a>";
    XmlPlexusConfiguration xml = new XmlPlexusConfiguration(Xpp3DomBuilder.build(new StringReader(text)));
    StringWriter wrt = new StringWriter();
    XmlUtil.toIndentedString(xml, 2, 0, wrt);
    String pretty = wrt.toString();
    assertEquals("<a>\n  <b>\n    <c>asdf</c>\n    <d/>\n  </b>\n</a>", pretty);
}