factory.setNamespaceAware(true);
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
SAXParser parser = factory.newSAXParser();
parser.parse(
new CloseShieldInputStream(stream),
new OfflineContentHandler(
getContentHandler(handler, metadata)));
} catch (ParserConfigurationException e) {
throw new TikaException("XML parser configuration error", e);
}