EclipseXMLOutputter (String lineSeparator) { EclipseXMLOutputter xmlOutputter = new EclipseXMLOutputter(lineSeparator); Format format = Format.getCompactFormat(). setIndent("\t"). setTextMode(Format.TextMode.NORMALIZE). setEncoding(CharsetToolkit.UTF8). setOmitEncoding(false). setOmitDeclaration(false); xmlOutputter.setFormat(format); return xmlOutputter; }