title: SimpleXML and xpath getting a node's value
body: <p>I have the following notes.xml XML file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;note&gt;
      &lt;to&gt;Tove&lt;/to&gt;
      &lt;from&gt;Jani&lt;/from&gt;
      &lt;heading&gt;Reminder&lt;/heading&gt;
      &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  </code></pre>
  
  <p>And this PHP script</p>
  
  <pre><code>&lt;?php
      $xml = simplexml_load_file('notes.xml');
      $result = $xml-&gt;xpath('//to');
      print_r($result);
      echo "&lt;br&gt;";
      echo $result;
  ?&gt; 
  </code></pre>
  
  <p>Then, why the output is the following? (THERE IS NOT TOVE VALUE)</p>
  
  <pre><code>Array ( [0] =&gt; SimpleXMLElement Object ( ) )
  Array 
  </code></pre>