title: java - Getting all content of a xml node as string
body: <p>I am using this code to parsing xml</p>
  
  <pre><code>    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      InputSource is = new InputSource();
      is.setCharacterStream(new StringReader(data));
      Document doc = db.parse(is);
  </code></pre>
  
  <p>Now I want to get all content from a xml node.
  Like from this xml</p>
  
  <pre><code>&lt;?xml version='1.0'?&gt;
  &lt;type&gt;
    &lt;human&gt;                     
      &lt;Name&gt;John Smith&lt;/Name&gt;              
      &lt;Address&gt;1/3A South Garden&lt;/Address&gt;    
    &lt;/human&gt;
  &lt;/type&gt;
  </code></pre>
  
  <p>So if want to get all content of <code>&lt;human&gt;</code> as text.</p>
  
  <blockquote>
  <pre><code>&lt;Name&gt;John Smith&lt;/Name&gt;
  &lt;Address&gt;1/3A South Garden&lt;/Address&gt;
  </code></pre>
  </blockquote>
  
  <p>How can I get it ?</p>