DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(source.getURI());  NodeList nl = document.getElementsByTagName("property"); if(nl != null && nl.getLength() > 0) { for(int i = 0 ; i < nl.getLength();i++) { Element el = (Element)nl.item(i); filteringProperties.setProperty(el.getAttribute("name"), el.getAttribute("value")); } }
source = m_resolver.resolveURI(propertiesStringURI);
    private AntProperties loadXMLPropertiesFromURI(                    AntProperties precedingProperties,                    String propertiesStringURI) throws MalformedURLException, IOException, ParserConfigurationException, SAXException {    	Source source = null;        InputStream in = null;        try {            if (debugging())                debug("Searching for forrest.properties.xml in" + source.getURI());                        source = m_resolver.resolveURI(propertiesStringURI);            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();            DocumentBuilder builder = factory.newDocumentBuilder();            Document document = builder.parse(source.getURI());                        NodeList nl = document.getElementsByTagName("property");            if(nl != null && nl.getLength() > 0) {              for(int i = 0 ; i < nl.getLength();i++) {                Element el = (Element)nl.item(i);                filteringProperties.setProperty(el.getAttribute("name"), el.getAttribute("value"));              }            }            if (debugging())                debug("Loaded:" + propertiesStringURI                                + filteringProperties.toString());                    } finally {            if (source != null) {                m_resolver.release(source);            }            if (in != null) {                try {                    in.close();                } catch (IOException e) {}            }        }                return filteringProperties;    }