public static XMLInputFactory getXMLInputFactory(ParseContext context) {
        XMLInputFactory factory = context.get(XMLInputFactory.class);
        if (factory != null) {
            return factory;
        }
        return XMLReaderUtils.getXMLInputFactory();
    }
Returns the StAX input factory specified in this parsing context.
If a factory is not explicitly specified, then a default factory
instance is created and returned. The default factory instance is
configured to be namespace-aware and to apply reasonable security
using the {@link XMLReaderUtils#IGNORING_STAX_ENTITY_RESOLVER}.

@return StAX input factory
tika-core/src/main/java/org/apache/tika/utils/XMLReaderUtils.java