Here you can find the source of createXmlReader()
private static SAXParserFactory createXmlReader()
//package com.java2s; //License from project: Apache License import javax.xml.parsers.SAXParserFactory; public class Main { private static SAXParserFactory createXmlReader() { SAXParserFactory spf = SAXParserFactory.newInstance(); try {/*from w ww. j a va 2 s . com*/ spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); return spf; } catch (Throwable e) { throw new RuntimeException(e); } } }