title: PHP - Delete XML Element
body: <p>I need to delete elements of an XML file using PHP. It will be done via ajax and I need to find the XML element via an attribute.</p>
  
  <p>This is my XML file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;messages&gt;
      &lt;message time="1248083538"&gt;
          &lt;name&gt;Ben&lt;/name&gt;
          &lt;email&gt;Ben's Email&lt;/email&gt;
          &lt;msg&gt;Bens message&lt;/msg&gt;
      &lt;/message&gt;
      &lt;message time="1248083838"&gt;
          &lt;name&gt;John Smith&lt;/name&gt;
          &lt;email&gt;john@smith.com&lt;/email&gt;
          &lt;msg&gt;Can you do this for me?&lt;/msg&gt;
      &lt;/message&gt;
  &lt;/messages&gt;
  </code></pre>
  
  <p>So what I would say is something like delete the element  where the time equals 1248083838.</p>
  
  <p>Ive been using Simple XML up until now and I've just realised it can do everything except delete elements.</p>
  
  <p>So how would I do this?</p>