title: Parsing complex XML using PHP
body: <p>I have the following complex, not quite well-structured XML:</p>
  
  <pre><code>&lt;event hometeam="K.Kanepi" awayteam="S.Lisicki" eventName="K.Kanepi-S.Lisicki" date="02/07/2013" time="14:05" datetime="2013-07-02T14:05:00+02:00"&gt;
      &lt;subevent title="Match odds" dsymbol="MATCH_ODDS"&gt;
          &lt;selection name="home" odds="3.1500" slipURL="URI/en/add-bet/3187-02072013,1"/&gt;
          &lt;selection name="away" odds="1.3500" slipURL="URI/en/add-bet/3187-02072013,2"/&gt;
      &lt;/subevent&gt;
  </code></pre>
  
  <p>I'm trying to parse it using this code:</p>
  
  <pre><code>$total_games = $xml-&gt;event-&gt;count();
  
  for ($i = 0; $i &lt; $total_games; $i++) {
      echo $xml-&gt;event[$i]-&gt;subevent.title;
  </code></pre>
  
  <p>$total games works correctly; however - when I try to parse subevent, I'm unsuccessful in getting the eventName, hometeam, date, etc.</p>