title: Deserializing into a List without a container element in XML
body: <p>In all the examples I've seen of using <code>XmlSerializer</code> any time a list or array happens you have some sort of container element like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;MyXml&gt;
    &lt;Things&gt;
      &lt;Thing&gt;One&lt;/Thing&gt;  
      &lt;Thing&gt;Two&lt;/Thing&gt;  
      &lt;Thing&gt;Three&lt;/Thing&gt;  
    &lt;/Things&gt;
  &lt;/MyXml&gt;
  </code></pre>
  <p>However, the XML I have has no container similar to <em>Things</em> above. It just starts repeating elements. (Incidentally, the XML is actually from Google's Geocode API)</p>
  <p>So, I have XML that looks like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;GeocodeResponse&gt;
    &lt;status&gt;OK&lt;/status&gt;
    &lt;result&gt;
      &lt;type&gt;locality&lt;/type&gt;
      &lt;type&gt;political&lt;/type&gt;
      &lt;formatted_address&gt;Glasgow, City of Glasgow, UK&lt;/formatted_address&gt;
      &lt;address_component&gt;
        &lt;long_name&gt;Glasgow&lt;/long_name&gt;
        &lt;short_name&gt;Glasgow&lt;/short_name&gt;
        &lt;type&gt;locality&lt;/type&gt;
        &lt;type&gt;political&lt;/type&gt;
      &lt;/address_component&gt;
      &lt;address_component&gt;
        &lt;long_name&gt;East Dunbartonshire&lt;/long_name&gt;
        &lt;short_name&gt;East Dunbartonshire&lt;/short_name&gt;
        &lt;type&gt;administrative_area_level_3&lt;/type&gt;
        &lt;type&gt;political&lt;/type&gt;
      &lt;/address_component&gt;
      &lt;!-- etc... --&gt;
    &lt;/result&gt;
    &lt;result&gt;
      &lt;!-- etc... --&gt;
    &lt;/result&gt;
    &lt;result&gt;
      &lt;!-- etc... --&gt;
    &lt;/result&gt;
  &lt;/GeocodeResponse&gt;
  </code></pre>
  <p>As you can see inside <em>result</em> the <em>type</em> element repeats without any <em>types</em> element that <em>XmlSerializer</em> appears to expect (or at least all the documents and examples I've seen). The same goes for the <em>address_component</em>.</p>
  <p>The code I currently have looks something like this:</p>
  <pre><code>[XmlRoot(&quot;GeocodeResponse&quot;)]
  public class GeocodeResponse
  {
      public GeocodeResponse()
      {
          this.Results = new List&lt;Result&gt;();
      }
  
      [XmlElement(&quot;status&quot;)]
      public string Status { get; set; }
  
      [XmlArray(&quot;result&quot;)]
      [XmlArrayItem(&quot;result&quot;, typeof(Result))]
      public List&lt;Result&gt; Results { get; set; }
  }
  </code></pre>
  <p>Every time I attempt to <em>deserialize</em> the XML I get zero items in my <em>Result</em> <em>List</em>.</p>
  <p>Can you suggest how I may get this to work as I'm currently not seeing it?</p>