title: How to get an xml element by index
body: <p>I have an xml file that contains a list of elements. I want to retrieve a specific element by index. I looked around for a while and didn't find anything that worked for me.</p>
  
  <p>I would have thought this would work, but it doesn't:</p>
  
  <pre><code>echo($xml-&gt;children()[0]);
  </code></pre>
  
  <p>I'm not very experienced in php, coming from a C# background, so any help is appreciated.</p>