Here you can find the source of newTransformerHandler()
public static TransformerHandler newTransformerHandler() throws TransformerConfigurationException
//package com.java2s; //License from project: Apache License import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; public class Main { private static SAXTransformerFactory transformerFactory; public static TransformerHandler newTransformerHandler() throws TransformerConfigurationException { if (transformerFactory == null) { transformerFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); }//from w ww .j av a2s . c om return transformerFactory.newTransformerHandler(); } }