title: How to use LINQ to XML to retrieve nested arrays?
body: <p>Here's a sample of the XML I want to read:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;hash&gt;
    &lt;result&gt;
      &lt;properties type="array"&gt;
        &lt;property&gt;
          &lt;registers type="array"&gt;
            &lt;register&gt;
              &lt;dials type="integer"&gt;6&lt;/dials&gt;
            &lt;/register&gt;
            &lt;register&gt;
              &lt;dials type="integer"&gt;6&lt;/dials&gt;
            &lt;/register&gt;
          &lt;/registers&gt;
          &lt;unit-balance type="integer"&gt;-104&lt;/unit-balance&gt;
        &lt;/property&gt;
      &lt;/properties&gt;
      &lt;account-number&gt;9001234&lt;/account-number&gt;
    &lt;/result&gt;
    &lt;version&gt;1.0&lt;/version&gt;
  &lt;/hash&gt;
  </code></pre>
  
  <p>I can read the first level with the following code, but how to get the registers, and have them associated with the corresponding property?</p>
  
  <pre><code>var rawProperties = from property in customerXml.Descendants("property")
                      select new 
                      {
                          UnitBalance = property.Element("unit-balance").Value
                      };
  </code></pre>