new StringReader("<elem>text</elem>")).getDocumentElement(true);
OMDocument document = factory.createOMDocument();
OMElement root = factory.createOMElement("root", null, document);
root.addChild(incompleteElement);
StringWriter out = new StringWriter();
document.serializeAndConsume(out);
assertXMLEqual("<root><elem>text</elem></root>", out.toString());
assertConsumed(incompleteElement);
}
}