title: Change XML node element value in PHP and save file
body: <pre><code>&lt;testimonials&gt;
      &lt;testimonial id="4c050652f0c3e"&gt;
          &lt;nimi&gt;John&lt;/nimi&gt;
          &lt;email&gt;test@test.com&lt;/email&gt;
          &lt;text&gt;Some text&lt;/text&gt;
          &lt;active&gt;1&lt;/active&gt;
          &lt;/testimonial&gt;
      &lt;testimonial id="4c05085e1cd4f"&gt;
          &lt;name&gt;ats&lt;/name&gt;
          &lt;email&gt;some@test.ee&lt;/email&gt;
          &lt;text&gt;Great site!&lt;/text&gt;
          &lt;active&gt;0&lt;/akctive&gt;
      &lt;/testimonial&gt;
  &lt;/testimonials&gt;
  </code></pre>
  
  <p>I have this XML strcuture and i need to find a testimonial with specific id and <strong>change</strong> its  <strong>value</strong> and save file.
  I have a PHP script deleting specific testimonial according its ID:</p>
  
  <pre><code>&lt;?php
  $xmlFile = file_get_contents('test.xml');
  $xml = new SimpleXMLElement($xmlFile);
  
  $kust_id = $_GET["id"];
  
  foreach($xml-&gt;testimonial as $story) {
      if($story['id'] == $kust_id) {
          $dom=dom_import_simplexml($story);
          $dom-&gt;parentNode-&gt;removeChild($dom);
  
          $xml-&gt;asXML('test.xml');
          header("Location: newfile.php");
      }
  }
  ?&gt;
  </code></pre>