title: Parse XML subitems using foreach()
body: <p>I have an XML file that needs parsing in PHP.  I am currenlty using simplexml_load_file to load the file like so:</p>
  
  <pre><code>$xml = simplexml_load_file('Project.xml');
  </code></pre>
  
  <p>Inside that XML file lies a structure like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;project&gt;
  &lt;name&gt;Project 1&lt;/name&gt;
  &lt;features&gt;
      &lt;feature&gt;Feature 1&lt;/feature&gt;
      &lt;feature&gt;Feature 2&lt;/feature&gt;
      &lt;feature&gt;Feature 3&lt;/feature&gt;
      &lt;feature&gt;Feature 4&lt;/feature&gt;
  &lt;/features&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>What I am trying to do is print the <code>&lt;name&gt;</code> contents along with EACH <code>&lt;feature&gt;</code> element within <code>&lt;features&gt;</code>.  I'm not sure how to do this because there is more than 1 element called <code>&lt;feature&gt;</code>.  Any help is greatly appreciated.</p>