} else {
xmlDocument.setEncoding(getEncoding());
xmlDocument.setVersion(getVersion());
}
XMLNode xmlNode = (XMLNode)sourceNode;
PrintWriter printWriter = new PrintWriter(resultWriter);
XDKPrintDriver xdkPrintDriver = new XDKPrintDriver(printWriter);
xdkPrintDriver.setFormattedOutput(isFormattedOutput());
xdkPrintDriver.setEncoding(getEncoding());
xdkPrintDriver.print(xmlNode);