private static void _transform(Source source, Result out) throws TransformerException {
        TransformerFactory factory = TransformerFactory.newInstance();
        factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);

        // this allows us to use UTF-8 for storing data,
        // plus it checks any well-formedness issue in the submitted data.
        Transformer t = factory.newTransformer();
        t.transform(source, out);
    }
private static void _transform ( Source source , Result out ) throws TransformerException { TransformerFactory factory = TransformerFactory . newInstance ( ) ; factory . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , true ) ; Transformer t = factory . newTransformer ( ) ; t . transform ( source , out ) ; }
potentially unsafe XML transformation.
@param source The XML input to transform.
@param out The Result of transforming the <code>source</code>.