Here you can find the source of buildXmlTransformer()
private static Transformer buildXmlTransformer() throws TransformerFactoryConfigurationError, TransformerConfigurationException
//package com.java2s; //License from project: Open Source License import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; public class Main { private static Transformer buildXmlTransformer() throws TransformerFactoryConfigurationError, TransformerConfigurationException { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); return transformer; }/*from ww w . j a va 2 s . com*/ }