I use the following code to parse the XML file.
DocumentBuilderFactory factory; DocumentBuilder builder; InputStream is; Document dom; try { factory = Docume
You can use StringReader :
StringReader sr = new StringReader(xml); InputSource is = new InputSource(sr); Document d = builder.parse(is);