title: Attributes from xml element not in simplexml array
body: <p>I am trying to read through an REA-XML file and using simplexml to convert the xml into an array</p>
  
  <pre><code>$xml = simplexml_load_string($data) or die("Error: Cannot create object");
  </code></pre>
  
  <p>There is a section in the XML that looks like this:</p>
  
  <pre><code>&lt;images&gt;
      &lt;img id="a" modTime="2009-01-01-12:30:00" url="http://image.jpg" format="jpg"/&gt;
      &lt;img id="m" modTime="2009-01-01-12:30:00" url="https://image.jpg" format="jpg"/&gt;
  &lt;/images&gt;
  </code></pre>
  
  <p>When converted to an array , an additional array element "@attributes" is created with the modTime etc in it. </p>
  
  <p>However, in the same XML , same level:</p>
  
  <pre><code>&lt;landDetails&gt;
          &lt;area unit="square"&gt;80&lt;/area&gt;
          &lt;frontage unit="meter"&gt;20&lt;/frontage&gt;
          &lt;depth unit="meter" side="rear"&gt;40&lt;/depth&gt;
          &lt;crossOver value="left"/&gt;
  &lt;/landDetails&gt;
  </code></pre>
  
  <p>The "unit" attribute is missing completely, 
  The value for "value" in the crossOver, is in an "@attributes" array, but the three other items for "unit" are missing completely from the var_dump</p>
  
  <p>Why do the unit values not show up in the @attribute array, or anywhere else in the landDetails section?</p>
  
  <p>full example XML:</p>
  
  <p><a href="http://rea-new-help.realestate.com.au.s159598.gridserver.com/wp-content/uploads/2013/05/rental_sample.xml" rel="nofollow">http://rea-new-help.realestate.com.au.s159598.gridserver.com/wp-content/uploads/2013/05/rental_sample.xml</a></p>