title: Remove Node from xml by attribute
body: <p>I have this example xml: </p>
  
  <pre><code>&lt;Forms&gt;
  &lt;Form Desc="sasld" DocType="1"&gt;
      &lt;topmostSubform ind="0"&gt;
          &lt;HouseNo ind="0"&gt;413&lt;/HouseNo&gt;
          &lt;ZipCode ind="0"&gt;82051&lt;/ZipCode&gt;
          &lt;PostOfficeBox ind="0"&gt;0&lt;/PostOfficeBox&gt;
      &lt;/topmostSubform&gt;
  &lt;/Form&gt;
  &lt;Form Desc="abcd" DocType="1"&gt;
      &lt;topmostSubform ind="0"&gt;
          &lt;TextField1 ind="24" /&gt;
          &lt;TextField1 ind="25" /&gt;
          &lt;TextField1 ind="26" /&gt;
          &lt;DisContActivity-5-0 ind="0" /&gt;
          &lt;DisWithFranActivity-5-0 ind="0" /&gt;
      &lt;/topmostSubform&gt;
  &lt;/Form&gt;
  &lt;Form Desc="abcd" DocType="5"&gt;
      &lt;topmostSubform ind="0"&gt;
          &lt;TextField1 ind="24" /&gt;
          &lt;TextField1 ind="25" /&gt;
      &lt;/topmostSubform&gt;
  &lt;/Form&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want to remove all nodes which are of type Form and its DocType attribute value is 1.</p>
  
  <p>I hold this xml in a Document object.</p>
  
  <p>i tried:</p>
  
  <pre><code>String xpath_string = "//Form[@DocType ='1']";
          XPathExpression xPathExpr = XPATH.compile(xpath_string);
          Object result_obj = xPathExpr.evaluate(document,XPathConstants.NODESET);
          NodeList nodes = (NodeList) result_obj;
          System.out.println(nodes.getLength());
          for(int i=1;i&lt;nodes.getLength();i++)
              document.removeChild(nodes.item(i));
  </code></pre>
  
  <p>But it gives "NOT_FOUND_ERR".</p>