Here you can find the source of getTransformer()
public static Transformer getTransformer()
//package com.java2s; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; public class Main { public static Transformer getTransformer() { Transformer transformer = null; try {//from w ww .ja va 2 s . c o m TransformerFactory transformerFactory = TransformerFactory.newInstance(); //transformerFactory.setAttribute("indent-number", 0); transformer = transformerFactory.newTransformer(); } catch (Exception exception) { exception.printStackTrace(); } return transformer; } }