* @return the sorted xml
* @throws java.io.IOException
*/
public ByteArrayOutputStream getSortedXml() throws IOException {
ByteArrayOutputStream sortedXml = new ByteArrayOutputStream();
BufferedLineSeparatorOutputStream bufferedLineOutputStream =
new BufferedLineSeparatorOutputStream(lineSeparatorUtil.toString(), sortedXml);
XMLOutputter xmlOutputter = new PatchedXMLOutputter(bufferedLineOutputStream, indentBlankLines);
xmlOutputter.setFormat(createPrettyFormat());
xmlOutputter.output(newDocument, bufferedLineOutputStream);