title: Looping through SimpleXMLElement to access attributes
body: <p>I am trying process data retrieved with SimpleXML and am having great difficulty.  I have read numerous threads here about this subject, they all LOOK like what I am doing, but mine are not working.  Here's what I've got:</p>
  
  <pre><code>&lt;ROOT&gt;
      &lt;ROWS COMP_ID="165462"&gt;
      &lt;ROWS COMP_ID="165463"&gt;
  &lt;/ROOT&gt;
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>$xml = simplexml_load_file('10.xml');
  foreach( $xml-&gt;ROWS as $comp_row ) {
      $id = $comp_row-&gt;COMP_ID;
  }
  </code></pre>
  
  <p>As I step through this in my debugger, I can see that $id is not set to the string value of COMP_ID, but becomes a SimpleXMLElement itself containing the CLASSNAME object.  I've tried many variations of addressing this attribute but none work, including $comp_row->attributes()->COMP_ID and others.</p>
  
  <p>What am I missing?</p>