Code example for CharArrayReader

0
			SAXParser sp = spf.newSAXParser();
			XMLReader xr = sp.getXMLReader();
			XMLParser parser = new XMLParser();
			parser.setParserMode(parserMode);
			xr.setContentHandler(parser);
			Reader reader = new CharArrayReader(XMLResponse.toCharArray());
			InputSource is = new InputSource(reader);
			is.setEncoding("UTF-8");
			xr.parse(is);
			return parser;
		} catch (Exception e) {
			Log.e("DEBUG", "No valid XML found", e);
			throw new ParseException("Unable to parse XML"); 
		} 
	} 
}