// simple validation
System.exit(runSimple(fd));
} else {
// generate xml output
XmlResultParser xrp = new XmlResultParser();
Element result = xrp.validate(fd);
Document document = result.getOwnerDocument();
document.appendChild(result);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");