DocumentBuilder builder = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); org.w3c.dom.Document doc = builder.parse(new File(file)); System.out.println(doc.getNodeName()); System.out.println(doc.getLocalName()); System.out.println(doc.getNamespaceURI()); org.w3c.dom.NodeList = doc.getElementsByTagName("type");