input = new SAXSource( xmlReader, target.getResourceInputSource()); output = new DOMResult();
input = new SAXSource(xmlReader, target.getResourceInputSource()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); output = new DOMResult(dbf.newDocumentBuilder().newDocument());
        XMLResource createXMLResource(XMLResource target) {            Source input = null;            DOMResult output = null;            TransformerFactory xformFactory = null;            Transformer idTransform = null;            XMLReader xmlReader = null;            long st = 0L;                        xmlReader = XMLResource.newXMLReader();            addHandlers(xmlReader);            setParserFeatures(xmlReader);                        st = System.currentTimeMillis();            try {                input = new SAXSource( xmlReader, target.getResourceInputSource());                output = new DOMResult();                xformFactory = TransformerFactory.newInstance();                idTransform = xformFactory.newTransformer();            } catch ( Exception ex ) {                throw new XRRuntimeException("Failed on configuring SAX to DOM transformer.", ex);            }                        try {                idTransform.transform( input, output );            } catch (Exception ex) {                throw new XRRuntimeException("Can't load the XML resource (using TRaX transformer). " + ex.getMessage());            }                        long end = System.currentTimeMillis();                        target.setElapsedLoadTime(end - st);                        XRLog.load("Loaded document in ~" + target.getElapsedLoadTime() + "ms");                        target.setDocument((Document)output.getNode());            return target;        }