try { return (TransformerFactory) ClassStuff.createFactory ( "javax.xml.transform.TransformerFactory", "com.icl.saxon.TransformerFactoryImpl"   ); } catch (ClassCastException e) {
ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = TransformerFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (TransformerFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new TransformerFactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); try { Class t = Class.forName("gnu.xml.transform.TransformerFactoryImpl"); return (TransformerFactory) t.newInstance(); } catch (Exception e) {
	public static TransformerFactory newInstance() 	throws TransformerFactoryConfigurationError	{	    try {		return (TransformerFactory) ClassStuff.createFactory (			"javax.xml.transform.TransformerFactory",			"com.icl.saxon.TransformerFactoryImpl"			// "gnu.xml.util.SAXNullTransformerFactory"			// "org.apache.xalan.processor.TransformerFactoryImpl"			);	    } catch (ClassCastException e) {		throw new TransformerFactoryConfigurationError(e);	    }	}