title: deserialization of complex object c#
body: <p>I'm trying to deserialize an object in xml which is deeply nested.</p>
  
  <p>Here's the xml code:</p>
  
  <pre><code>&lt;modules&gt;
      &lt;channel&gt;
        &lt;resources&gt;
          &lt;resource name="x" refresh_interval="180"&gt;... text ...&lt;/resource&gt;
          &lt;resource name="y" refresh_interval="180"&gt;..text..&lt;/resource&gt;
          &lt;resource name="z" refresh_interval="180"&gt;... text ...&lt;/resource&gt;
        &lt;/resources&gt;
      &lt;/channel&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>I have a lot more elements like channel in the modules node, but for the example this one is enough I hope.
  Then I have my class:</p>
  
  <pre><code>    public class IdentifyData{
  
      public Modules modules;
  }
  
  public class Modules
  {
       public List&lt;Resources&gt; channels;
  }
  
      public class Resources
      {
          [DataMember(Name = "name")]
          public string name { get; set; }
  
          [DataMember(Name ="url")]
          public string url { get; set; }
  
          [DataMember(Name = "refresh_interval")]
          public string refresh_interval { get; set; }
      }
  </code></pre>
  
  <p>I tried with XmlArray and everything and it just doesn't want to work, and of course I searched all over stack overflow and I couldn't find the right answer. </p>