After make changes inside XML file I want to save my result. I'm using below code:
OutputStream outputStream = new FileOutputStream(
new File("C:\\Users\\ABC\\Desktop\\abc.xml")
);
OutputFormat outputFormat = new OutputFormat(doc, "UTF-8", true);
outputFormat.setOmitComments(true);
outputFormat.setLineWidth(0);
XMLSerializer serializer = new XMLSerializer(outputStream, outputFormat);
serializer.serialize(doc);
outputStream.close();
But into my XML is added line:
<?xml version="1.0" encoding="UTF-8"?>
How to remove it or avoid to add it?