DocumentBuilder parsing error with xml
<p>I have a XML in String variable and I want to pass that value into the parse() of DocumentBuilder.</p>

<pre><code>String xml = "&lt;?xml version="1.0 ....&gt;";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(new StringReader(xml)));
</code></pre>

<p>But, seems like the last line doesnt work as doc is null.</p>

<p>Is there anything wrong with this?  I am just trying take a xml value and convert it to Document.</p>

<p>Thanks for help.</p>
