Here you can find the source of getTransformer()
static private Transformer getTransformer()
//package com.java2s; //License from project: LGPL import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; public class Main { private static Transformer transformer = null; static private Transformer getTransformer() { if (transformer == null) { try { transformer = TransformerFactory.newInstance() .newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); } catch (Exception e) { e.printStackTrace();/* www .j a v a 2s . c o m*/ return null; } } return transformer; } }