Configuring SAX parser factory to produce alternate parser
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; public class Main { public static void main(String[] args) throws Exception { System.setProperty("avax.xml.parsers.SAXParserFactory", "org.apache.xerces.parsers.SAXParser"); SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); } }