title: Remove XML child with same name
body: <p>I have a large XML with the following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;valasz xmlns="" verzio="1.0"&gt;
  &lt;arak&gt;
  &lt;ar&gt;
  &lt;cikkid&gt;439902&lt;/cikkid&gt;
  &lt;cikkszam&gt;DVDV-16Z10&lt;/cikkszam&gt;
  &lt;listaar&gt;1225,0000000&lt;/listaar&gt;
  &lt;ar&gt;1157,6200000&lt;/ar&gt;
  &lt;akcios_ar&gt;1157,6200000&lt;/akcios_ar&gt;
  &lt;devizanem&gt;HUF&lt;/devizanem&gt;
  &lt;/ar&gt;
  &lt;ar&gt;
  ..
  &lt;ar&gt;1157,6200000&lt;/ar&gt;
  ...
  &lt;/ar&gt;
  &lt;/arak&gt;
  </code></pre>
  
  <p>What i want is to remove arak->ar->ar child because its causing in the import it looks like duplicates, and slowing down the process. </p>
  
  <p>I have tried the following:</p>
  
  <pre><code>    $node = readfile($arlista[0]);
      $nodes = simplexml_load_string($node);
      $arnode = $nodes-&gt;xpath("/valasz/arak/ar/ar");
          foreach ($arnode as &amp;$ar){
              $nodes-&gt;removeChild($ar);
          }
      echo $nodes;
  </code></pre>
  
  <p>And this only returns me the original xml, without removing the arak->ar->ar child nodes.</p>
  
  <p>What am i doing wrong?</p>