private Document parse(InputStream xmlIn) throws IOException {
Document xmlDoc = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
builder.setEntityResolver(new EntityResolverImpl());
xmlDoc = builder.parse(xmlIn);
} catch (ParserConfigurationException ex) {
throw new IOException(ex.getMessage());
} catch (SAXException ex) {
throw new IOException(ex.getMessage());