XdmNode docB = alternate.read();
XdmNode dxpdoc = dxp.read();
try {
DXPConfiguration dxpconfig = new DXPConfiguration(S9apiUtils.xdmToInputSource(runtime, dxpdoc), null, false);
PipelinedComparator comparator = dxpconfig.generate();
// FIXME: Grotesque hackery!
StringWriter sw = new StringWriter();
Serializer serializer = new Serializer();
serializer.setOutputWriter(sw);
S9apiUtils.serialize(runtime, docA, serializer);
String docAxml = sw.toString();
sw = new StringWriter();
serializer = new Serializer();
serializer.setOutputWriter(sw);
S9apiUtils.serialize(runtime, docB, serializer);
String docBxml = sw.toString();
StringBuffer buf = new StringBuffer();
comparator.compare(docAxml, docBxml, buf);
StringReader sr = new StringReader(buf.toString());
XdmNode doc = runtime.parse(new InputSource(sr));
result.write(doc);
} catch (Exception e) {