protected XMLReader createParser() throws Exception {
		XMLReader parser = null;

		// Try using JAXP...
		// Note we need JAXP 1.1, and if JAXP 1.0 is all that's
		// available then the getXMLReader call fails and we skip
		// to the hard coded default parser
		try {
			Class<?> factoryClass = Class
					.forName("javax.xml.parsers.SAXParserFactory");

			// factory = SAXParserFactory.newInstance();
			Method newParserInstance = factoryClass.getMethod("newInstance");
			Object factory = newParserInstance.invoke(null);

			// jaxpParser = factory.newSAXParser();
			Method newSAXParser = factoryClass.getMethod("newSAXParser");
			Object jaxpParser = newSAXParser.invoke(factory);

			// parser = jaxpParser.getXMLReader();
			Class<? extends Object> parserClass = jaxpParser.getClass();
			Method getXMLReader = parserClass.getMethod("getXMLReader");
			parser = (XMLReader) getXMLReader.invoke(jaxpParser);
		} catch (ClassNotFoundException e) {
			// e.printStackTrace();
		} catch (InvocationTargetException e) {
			// e.printStackTrace();
		} catch (NoSuchMethodException e) {
			// e.printStackTrace();
		} catch (IllegalAccessException e) {
			// e.printStackTrace();
		}

		// Check to see if we got a parser yet, if not, try to use a
		// hard coded default
		if (parser == null) {
			parser = XMLReaderFactory
					.createXMLReader("org.apache.xerces.parsers.SAXParser");
		}
		return parser;
	}