private static Document loadDocument(Resource xmlFile) throws SAXException, IOException {
  DOMParser parser=new DOMParser();
  InputStream is=null;
  try {
    is=IOUtil.toBufferedInputStream(xmlFile.getInputStream());
    InputSource source=new InputSource(is);
    parser.parse(source);
  }
  finally {
    IOUtil.closeEL(is);
  }
  return parser.getDocument();
}

private static Document loadDocument ( Resource xmlFile ) throws SAXException , IOException { DOMParser parser = new DOMParser ( ) ; InputStream is = null ; try { is = IOUtil . toBufferedInputStream ( xmlFile . getInputStream ( ) ) ; InputSource source = new InputSource ( is ) ; parser . parse ( source ) ; } finally { IOUtil . closeEL ( is ) ; } return parser . getDocument ( ) ; }
load xml document from xml file
