Here you can find the source of parseAIMLFile(File file)
public static Node parseAIMLFile(File file) throws ParserConfigurationException, IOException, SAXException
//package com.java2s; //License from project: Apache License import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.File; import java.io.IOException; public class Main { public static Node parseAIMLFile(File file) throws ParserConfigurationException, IOException, SAXException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dbBuilder = dbFactory.newDocumentBuilder(); Document document = dbBuilder.parse(file); document.getDocumentElement().normalize(); return document.getDocumentElement(); }/*from w ww. j a v a 2 s .co m*/ }