StAXParserConfiguration.PRESERVE_CDATA_SECTIONS, in);
try {
OMElement element = builder.getDocumentElement();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
if (cache) {
element.serialize(baos);
} else {
element.serializeAndConsume(baos);
}
assertXMLIdentical(compareXML(new InputSource(new ByteArrayInputStream(control)),
new InputSource(new ByteArrayInputStream(baos.toByteArray()))), true);