System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory");
initializePackageParsers();
SMOutputFactory smFactory = new SMOutputFactory(XMLOutputFactory.newInstance());
XMLStreamWriter2 streamWriter = smFactory.createStax2Writer(stream);
// For this to work, the elements need to be completely empty (no whitespace or line return)
streamWriter.setProperty(XMLOutputFactory2.P_AUTOMATIC_EMPTY_ELEMENTS, Boolean.TRUE);
SMOutputDocument outputDocument = SMOutputFactory.createOutputDocument(