title: Parsing XML with PHP's simpleXML
body: <p>I'm learning how to parse XML with PHP's simple XML.  My code is:</p>
  
  <pre><code>&lt;?php
  $xmlSource = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?&gt;    &lt;Document xmlns=\"http://www.apple.com/itms/\" artistId=\"329313804\" browsePath=\"/36/6407\" genreId=\"6507\"&gt;    &lt;iTunes&gt; myApp &lt;/iTunes&gt; &lt;/Document&gt;";
  
  $xml = new SimpleXMLElement($xmlSource);
  
  $results = $xml-&gt;xpath("/Document/iTunes");
  foreach ($results as $result){
   echo $result.PHP_EOL;  
  }
  
  print_r($result);
  ?&gt;
  </code></pre>
  
  <p>When this runs it returns a blank screen, with no errors.  If I remove all the attributes from the Document tag, it returns :</p>
  
  <pre><code>myApp SimpleXMLElement Object ( [0] =&gt; myApp )
  </code></pre>
  
  <p>Which is the expected result.</p>
  
  <p>What am I doing wrong?  Note that I don't have control over the XML source, since it's coming from Apple.</p>