title: Parsing a soap message with dom library in Java
body: <p>Have this soap message</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;soapenv:Body&gt;
        &lt;BRANCH xmlns="https://ya.yandex.ru/get-instance"&gt;
           &lt;mtu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" /&gt;
           &lt;header&gt;
              &lt;MANE&gt;032036&lt;/MANE&gt;
              &lt;TYPE&gt;GET&lt;/TYPE&gt;
           &lt;/header&gt;
           &lt;body&gt;
              &lt;BR_CODE&gt;666&lt;/BR_CODE&gt;
              &lt;NAME&gt;hello&lt;/NAME&gt;
               &lt;ADDRESS&gt;USA&lt;/ADDRESS&gt;
              &lt;IS_ACTIVE&gt;true&lt;/IS_ACTIVE&gt;
           &lt;/body&gt;
        &lt;/BRANCH&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to get only this. With tags:</p>
  
  <pre><code>         &lt;BR_CODE&gt;666&lt;/BR_CODE&gt;
          &lt;NAME&gt;hello&lt;/NAME&gt;
           &lt;ADDRESS&gt;USA&lt;/ADDRESS&gt;
          &lt;IS_ACTIVE&gt;true&lt;/IS_ACTIVE&gt;
  </code></pre>
  
  <p>But i have this in output :</p>
  
  <pre><code>666 hello USA true
  </code></pre>
  
  <p>There is my code</p>
  
  <pre><code>      DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
      Document doc = dBuilder.parse((new InputSource(new StringReader(response))));
      doc.getDocumentElement().normalize();
      NodeList list = doc.getElementsByTagName("body");
      for (int i = 0; i &lt; list.getLength(); i++) {
          Node node = list.item(i);
          System.out.println(node.getTextContent());
      }
  </code></pre>
  
  <p>Whats wrong in my code? Can not get what i want.</p>