I am using StAX XML stream writer to write the XML file. It writes all the data in a single line. I want all the tags to be indented instead of a single line.
stax-utils provides class IndentingXMLStreamWriter which does the job:
IndentingXMLStreamWriter
XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(...); writer = new IndentingXMLStreamWriter(writer); ...
2.1m questions
2.1m answers
60 comments
56.9k users