Code example for SAXSource

            StreamResult result = new StreamResult(System.out);
            // Set up the transformer to process the SAX events generated 
            // by the last filter in the chain 
            Transformer transformer = stf.newTransformer();
            SAXSource transformSource = new SAXSource(filter2, input);
            transformer.transform(transformSource, result);
        } catch (TransformerConfigurationException tce) {
            // Error generated by the parser 
            System.out.println("\n** Transformer Factory error");
            System.out.println("   " + tce.getMessage());
            // Use the contained exception, if any 
            Throwable x = tce;
            if (tce.getException() != null) {
                x = tce.getException();
Connect your IDE to all the code out there  Get Codota for Java