public static XMLInputFactory createSecureXMLInputFactory() {
    XMLInputFactory factory = XMLInputFactory.newInstance();
    factory.setProperty( IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE );
    return factory;
  }
@Test
  public void secureXmlInputStream() {
    XMLInputFactory factory = XMLParserFactoryProducer.createSecureXMLInputFactory();
    assertEquals( false, factory.getProperty( IS_SUPPORTING_EXTERNAL_ENTITIES ) );
  }