307308309310311312313314315316317
XMLStreamWriter writer; try { writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out); xp.setInclusion(3); xp.setDerivedKeys(true); xp.serialize(writer); writer.flush(); } catch (XMLStreamException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } }