Here you can find the source of getTransformerFactory()
public static synchronized TransformerFactory getTransformerFactory()
//package com.java2s; import javax.xml.transform.TransformerFactory; public class Main { private static TransformerFactory TRANSFORMER_FACTORY; public static synchronized TransformerFactory getTransformerFactory() { if (TRANSFORMER_FACTORY == null) { TRANSFORMER_FACTORY = TransformerFactory.newInstance(); }/* w w w . j a v a 2 s.c o m*/ return TRANSFORMER_FACTORY; } }