title: Really deleting nodes in XMLParser Object Groovy
body: <p>How to REALLY remove a node via XMLParser:</p>
  <pre><code> x='''&lt;X&gt;
  &lt;A&gt;
   &lt;B c3='1'&gt;
     &lt;C1&gt;a&lt;/C1&gt;
     &lt;C2&gt;b&lt;/C2&gt;
   &lt;/B&gt;
   &lt;B c3='2'&gt;
     &lt;C1&gt;e&lt;/C1&gt;
     &lt;C2&gt;e&lt;/C2&gt;
   &lt;/B&gt;
   &lt;B c3='3'&gt;
     &lt;C1&gt;f&lt;/C1&gt;
     &lt;C2&gt;f&lt;/C2&gt;
   &lt;/B&gt;
  &lt;/A&gt;
  &lt;/X&gt;
  '''
  
  xml=new XmlParser().parseText(x)
  def nodeToDel=xml.A.B.find{it.@C1='a'}
  xml.remove(nodeToDel)
  println xml
  new XmlNodePrinter(new PrintWriter(new FileWriter(new File('c:/temp/a.xml')))).print(xml)
  </code></pre>
  <p>Seems to work  BUT!!!!
  as i translated this to my problem it still saves the original xml althoguh returning true after running remove-method.</p>
  <p>I googled a little bit and found this <a href="http://jira.codehaus.org/browse/GROOVY-1832" rel="nofollow noreferrer">BUG</a>. And it seems as i am affected now of that. How can i solve it? Is there a workaround, or do i have to get back to the roots and start to copying it linewise...?? Is groovy really ungroovy here :-/</p>
  <p><em><strong>edit</strong></em>: As written below, and got experience from that, it is not possible to remove the  tag where  equals 'e' this way. Only the first Record will be removed. I think there is a problem with the xml format. Not having the needed format:</p>
  <p><code>&lt;A x='1' y='2'&gt;&lt;/A&gt;</code></p>
  <p>and having it in the format</p>
  <p><code>&lt;A&gt; &lt;x&gt;1&lt;/x&gt; &lt;y&gt;2&lt;/y&gt; &lt;/A&gt;</code></p>
  <p>Is somebody able to reproduce this bug?</p>
  <p><em><strong>edit2</strong></em>: I am using the GroovyConsole 1.8.0. Added the c3 attributes to the example. Tried to remove it with same method, same bug: The first B section was removed...
  Now the most impressing bug: Tried it with other code:</p>
  <pre><code>def xml=new XmlParser().parseText(x)
  xml.A.remove(xml.A.B.find{it.@'c3'= '3'}) //want to remove third section
  new XmlNodePrinter(new PrintWriter(new FileWriter(new File('c:/temp/a.xml')))).print(xml)
  </code></pre>
  <p>results that the first section the property c3 is changed to 3 ?!?!?!?!? wtf...</p>
  <p>I am trying  to find a solution for a week now, it is quite exhausting...</p>
  <p>Somebody an idea?</p>