public static Transformer newTransformer(String xsltFileName)
            throws TransformerConfigurationException {

        File xsltFile = new File(xsltFileName);
        Templates template = cache.get(xsltFileName);

        if (template == null) {
            lock.writeLock().lock();
            try {
                if (!cache.containsKey(xsltFileName)) {
                    Source xslSource = new StreamSource(xsltFile);
                    TransformerFactory transFact = TransformerFactory.newInstance();
                    Templates templates = transFact.newTemplates(xslSource);
                    template = templates;
                    cache.put(xsltFileName, template);
                }
                else {
                    template = cache.get(xsltFileName);
                }
            } finally {
                lock.writeLock().unlock();
            }
        }

        return template.newTransformer();
    }