title: Return parent node after string search in XML - PHP
body: <p>I have an XML file like so:</p>
  
  <pre><code>&lt;GenResponse&gt;
    &lt;Detail1&gt;&lt;/Detail1&gt;
    &lt;Detail2&gt;&lt;/Detail&gt;
    &lt;DataNodes&gt;
      &lt;DataNode&gt;
        &lt;NodeDetails1&gt;
          &lt;node4&gt;Parrot Musky Truck Moo&lt;/node4&gt;
          &lt;node5&gt;Tinker Singer Happy Fool&lt;/node5&gt;
          &lt;node6&gt;
            &lt;FurtherDetails&gt;
              &lt;Node&gt;Musky&lt;/Node&gt;
              &lt;Node&gt;Lorem Ipsum&lt;/Node&gt;
            &lt;/FurtherDetails&gt;
        &lt;/NodeDetails1&gt;
        &lt;NodeDetails2&gt;ID&lt;/NodeDetails2&gt;
      &lt;/DataNode&gt;
      &lt;DataNode&gt;
        &lt;NodeDetails1&gt;
          &lt;node4&gt;Sky Star Panet Shoe&lt;/node4&gt;
          &lt;node5&gt;Rusky Husky Musky Boo&lt;/node5&gt;
        &lt;/NodeDetails1&gt;
        &lt;NodeDetails2&gt;ID&lt;/NodeDetails2&gt;
      &lt;/DataNode&gt;
    &lt;/DataNodes&gt;
  &lt;/GenResponse&gt;
  </code></pre>
  
  <p>I would like to know how I would inject a search string "Musky" to a PHP function and get back <code>&lt;DataNode&gt;...&lt;/DataNode&gt;</code> &amp; <code>&lt;DataNode&gt;...&lt;/DataNode&gt;</code> back?</p>
  
  <p>Essentially I would like to search a huge XML file for a string and return all the DataNode's which contain the string back.</p>
  
  <p>If this is possible with SimpleXML it would be great. Else any other solution is also fine. </p>
  
  <p>EDIT: Notice how "Musky" can be in different nodes under <code>&lt;DataNode&gt;</code></p>