XFormEmulationTransformer transformer = new XFormEmulationTransformer();
Document outputDoc = transformer.transform(protocol, inputDoc);
// convert Document to markup
String canonicalExpectedXML = tester.render(expectedDoc);
String actualXML = tester.render(outputDoc);
// compare the actual markup with that expected
assertXMLEquals("Actual XML does not match expected XML." +
"\nExpectedXML:\n" + canonicalExpectedXML +
"\nActualXML:\n" + actualXML,