TransformerHandler serializer = factory.newTransformerHandler();
serializer.getTransformer().setOutputProperties(format);
serializer.setResult(new StreamResult(outFile));
this.parser = new ExtendedDirectParserProcessor();
this.parser.setLog(log);
this.parser.setFlatten(this.flatten);
this.parser.setExtendedGrammar(this.grammar);
this.parser.setContentHandler(serializer);