title: Search XML file *based* on search criteria and remove nodes - ASP or PHP
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4906073/a-simple-program-to-crud-node-and-node-values-of-xml-file">A simple program to CRUD node and node values of xml file</a>  </p>
  </blockquote>
  
  
  
  <p>I am not looking for an exact attribute or and exact node text. Example</p>
  
  <pre><code>&lt;Items&gt;
    &lt;book&gt;
      &lt;title&gt; Beginning Java &lt;/title&gt;
    &lt;/book&gt;
     &lt;book&gt;
      &lt;title&gt; Beginning ASP &lt;/title&gt;
    &lt;/book&gt;
    &lt;book&gt;
      &lt;title&gt; Beginning Java &lt;/title&gt;
    &lt;/book&gt;
    &lt;book&gt;
      &lt;title&gt; Advance Java &lt;/title&gt;
    &lt;/book&gt;
    &lt;book&gt;
      &lt;title&gt; Advance ASP &lt;/title&gt;
    &lt;/book&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>What I want to be able too is find all books that has "Beginning" in the title or "Advance" in the title. Sort of wild type search. What do I need, XPATH? Either ASP.NET or PHP code will help.</p>
  
  <p>I am doing this to write a utility to remove broken links in iTunes music library on MAC.</p>
  
  <p>Thank you</p>
  
  <p><strong>Edit: Help needed with the actual XML</strong>
  I am searching based on the  in front of "Location" key. Never came across such an XML which has  and .</p>
  
  <p>Thanks again</p>
  
  <pre><code>&lt;key&gt;5175&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;Track ID&lt;/key&gt;&lt;integer&gt;5175&lt;/integer&gt;
          &lt;key&gt;Name&lt;/key&gt;&lt;string&gt;02 - Track 02&lt;/string&gt;
          &lt;key&gt;Artist&lt;/key&gt;&lt;string&gt;Abba&lt;/string&gt;
          &lt;key&gt;Album&lt;/key&gt;&lt;string&gt;Abba Gold&lt;/string&gt;
          &lt;key&gt;Genre&lt;/key&gt;&lt;string&gt;English&lt;/string&gt;
          &lt;key&gt;Kind&lt;/key&gt;&lt;string&gt;MPEG audio file&lt;/string&gt;
          &lt;key&gt;Size&lt;/key&gt;&lt;integer&gt;5816448&lt;/integer&gt;
          &lt;key&gt;Total Time&lt;/key&gt;&lt;integer&gt;242285&lt;/integer&gt;
          &lt;key&gt;Track Number&lt;/key&gt;&lt;integer&gt;2&lt;/integer&gt;
          &lt;key&gt;Date Modified&lt;/key&gt;&lt;date&gt;2003-09-28T14:37:38Z&lt;/date&gt;
          &lt;key&gt;Date Added&lt;/key&gt;&lt;date&gt;2011-06-19T20:30:08Z&lt;/date&gt;
          &lt;key&gt;Bit Rate&lt;/key&gt;&lt;integer&gt;192&lt;/integer&gt;
          &lt;key&gt;Sample Rate&lt;/key&gt;&lt;integer&gt;44100&lt;/integer&gt;
          &lt;key&gt;Persistent ID&lt;/key&gt;&lt;string&gt;9030665BDB2B4A20&lt;/string&gt;
          &lt;key&gt;Track Type&lt;/key&gt;&lt;string&gt;File&lt;/string&gt;
          &lt;key&gt;Location&lt;/key&gt;&lt;string&gt;file://localhost/Users/macbookpro/Music/iTunes/iTunes%20Media/Music/Abba/Abba%20Gold/02%2002%20-%20Track%2002.mp3&lt;/string&gt;
          &lt;key&gt;File Folder Count&lt;/key&gt;&lt;integer&gt;5&lt;/integer&gt;
          &lt;key&gt;Library Folder Count&lt;/key&gt;&lt;integer&gt;1&lt;/integer&gt;
      &lt;/dict&gt;
  </code></pre>