title: Delete a node with simplexml in php
body: <p>I have a xml file with servers in it.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;servers&gt;
     &lt;server&gt;
        &lt;location&gt;Belgium&lt;/location&gt;
        &lt;ip&gt;192.168.0.1&lt;/ip&gt;
        &lt;port&gt;8080&lt;/port&gt;
        &lt;crt&gt;&lt;/crt&gt;
     &lt;/server&gt;
     &lt;server&gt;
        &lt;location&gt;Fhoto&lt;/location&gt;
        &lt;ip&gt;192.168.0.5&lt;/ip&gt;
        &lt;port&gt;7841&lt;/port&gt;
        &lt;crt&gt;http://127.0.0.1/serv.crt&lt;/crt&gt;
     &lt;/server&gt;
     &lt;server&gt;
        &lt;location&gt;TestingPanel&lt;/location&gt;
        &lt;ip&gt;192.168.1.2&lt;/ip&gt;
        &lt;port&gt;6969&lt;/port&gt;
        &lt;crt&gt;http://testingpanel.com/server.crt&lt;/crt&gt;
     &lt;/server&gt;
     &lt;server&gt;
        &lt;location&gt;TestingPanel2&lt;/location&gt;
        &lt;ip&gt;192.168.1.3&lt;/ip&gt;
        &lt;port&gt;6968&lt;/port&gt;
        &lt;crt&gt;http://testingpanel.com/server1.crt&lt;/crt&gt;
     &lt;/server&gt;
  &lt;/servers&gt;
  </code></pre>
  
  <p>I made a php page that can add servers to the file and it works great. Now I want to make a form where you can enter the IP and the php script should delete the whole node.</p>
  
  <p>So for example. I have a form with a textbox and I enter "192.168.0.1". I want it to delete this:</p>
  
  <pre><code>   &lt;server&gt;
        &lt;location&gt;Belgium&lt;/location&gt;
        &lt;ip&gt;192.168.0.1&lt;/ip&gt;
        &lt;port&gt;8080&lt;/port&gt;
        &lt;crt&gt;&lt;/crt&gt;
     &lt;/server&gt;
  </code></pre>
  
  <p>I have this so far (basically nothing):</p>
  
  <pre><code>if (isset($_POST["deleteServer"])) { 
      //do processing
  }
  </code></pre>
  
  <p>Please guide me in the right direction as I have no idea how to do this. Thanks in advance!</p>