title: Remove XML Record based on date node
body: <p>I have an XML file that has loads of records that I don't need, the XML file is being few into  WordPress via XMLRPC. What I need to do is strip all records based on the date that I don't need so that I don't have hundreds of duplicated posts via PHP. MY XML file is formatted as so:</p>
  
  <pre><code>&lt;data&gt;
   &lt;in&gt;
     &lt;a&gt;First Name&lt;/a&gt;
     &lt;b&gt;Surname &lt;/b&gt;
     &lt;c&gt;07:00:00 11/08/2012&lt;/c&gt;
   &lt;/in&gt;
   &lt;in&gt;
     &lt;a&gt;First Name&lt;/a&gt;
     &lt;b&gt;Surname &lt;/b&gt;
     &lt;c&gt;08:00:00 11/09/2012&lt;/c&gt;
   &lt;/in&gt;
   &lt;in&gt;
     &lt;a&gt;First Name&lt;/a&gt;
     &lt;b&gt;Surname &lt;/b&gt;
     &lt;c&gt;09:00:00 11/10/2012&lt;/c&gt;
   &lt;/in&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>So I need to check whether  is yesterday, if it is keep the  record, if it's before that to delete it from the XML file. From hunting around I have this so far:</p>
  
  <pre><code>&lt;?php
  
  $DATE = date( "Y-m-d", mktime(0, 0, 0, date("m"), date("d")-1, date("y")) );
  $searchString = '';
  $doc = new DOMDocument;
  $doc-&gt;preserveWhiteSpace = FALSE;
  $doc-&gt;load('file' . $DATE . '.xml');
  
  $xPath = new DOMXPath($doc);
  $query = sprintf('//in[./c[contains(., "%s")]]', $searchString);
  foreach($xPath-&gt;query() as $node) {
  $node-&gt;parentNode-&gt;removeChild($node);
  }
  $doc-&gt;formatOutput = TRUE;
  echo $doc-&gt;saveXML();
  
  ?&gt;
  </code></pre>
  
  <p>If this will work then I guess I just need the correct searchstring, sorry I'm not great with xPath</p>