XMLOutputter outputter = new XMLOutputter();
outputter.setOmitDeclaration(true);
parser.setXMLFilter(STANDARD_ELEMENT_FILTER);
Document cleaned = parser.build(new StringReader(
outputter.outputString(doc)));
// For some reason the outputter always appends a '\r\n' to the end
// so just add this to the expected string anyway.
String expected = part1 + " /></policies></device>" +
PrivateAccessor.getField(XMLOutputter.class,