title: Parsing an XML with Xpath in PHP
body: <p>Consider the following code :</p>
  
  <pre><code>$dom = new DOMDocument();
  $dom-&gt;loadXML($file);
  
  $xmlPath = new DOMXPath($dom);
  $arrNodes = $xmlPath-&gt;query('*/item');
  foreach($arrNodes as $item){
  //missing code
  }
  </code></pre>
  
  <p>The $file is an xml and each item has a title and a description.
  How can I display them (title and description)?</p>
  
  <pre><code>$file = "&lt;item&gt;
     &lt;title&gt;test_title&lt;/title&gt;
     &lt;desc&gt;test&lt;/desc&gt;
  &lt;/item&gt;";
  </code></pre>