How do I get contents inside an XML Node as String in Java
<p>I am looking for something like this :</p>

<pre><code>&lt;Node1&gt;
   &lt;Child2 attr1="abc"&gt;
   &lt;Child3 attr2="xyz"&gt;
&lt;Node1&gt;
</code></pre>

<p>From Node1 , I want to get the contents inside the node as text. The output I want is </p>

<pre><code>"&lt;Child2 attr1="abc"&gt;&lt;Child3 attr2="xyz"&gt;"
</code></pre>
