I like to write an xml Elem to a file, but I want to set the line separator between each node of the elem, so when opening the file under windows or ubuntu I have the correct format. for example :
val lineSep = System.getProperty("line.separator")
val xmlData : Elem = <person>
<firstName>John</firstName>
<lastName>Doe</lastName>
<emails>
<email type=”primary”>john.doe@noone.com</email>
<email type=”secondary”>john.doe@noone.com</email>
</emails>
<address>
<street>595 Market Street</street>
<city>San Francisco</city>
<zip>94105</zip>
</address>
</person>
val xmlStreamWriter = XMLOutputFactory.newInstance.createXMLStreamWriter(outputstream)
xmlStreamWriter.writeDTD(xmlData)
How to write it into a file considering the lineSeparator? the XMLOutputFactory have the method setProperty() is it possible to specify the line separator here?