title: XML string deserialization into c# object
body: <p>I receive xml file like this.</p>
  
  <pre><code>&lt;radio&gt;
    &lt;channel id="Opus"&gt;
      &lt;display-name&gt;Opus&lt;/display-name&gt;
      &lt;icon src="" /&gt;
    &lt;/channel&gt;
    &lt;channel id="Klasika"&gt;
      &lt;display-name&gt;Klasika&lt;/display-name&gt;
      &lt;icon src="" /&gt;
    &lt;/channel&gt;
    &lt;channel id="LR"&gt;
      &lt;display-name&gt;LR&lt;/display-name&gt;
      &lt;icon src="" /&gt;
    &lt;/channel&gt;
    &lt;programme channel="Opus" start="20130203060000" stop="20130203110000" duration="050000"&gt;
      &lt;title lang="lt"&gt;OPUS muzika.&lt;/title&gt;
      &lt;desc lang="lt"&gt;OPUS muzika.&lt;/desc&gt;
      &lt;category lang="lt"&gt;muzikos laidos&lt;/category&gt;
      &lt;date&gt;2013.02.03&lt;/date&gt;
    &lt;/programme&gt;
    &lt;programme channel="Opus" start="20130203110000" stop="20130203150000" duration="040000"&gt;
      &lt;title lang="lt"&gt;Vėlyvi pusryčiai su OPUS.&lt;/title&gt;
      &lt;desc lang="lt"&gt;Vėlyvi pusryčiai su OPUS.&lt;/desc&gt;
      &lt;category lang="lt"&gt;muzikos laidos&lt;/category&gt;
      &lt;date&gt;2013.02.03&lt;/date&gt;
    &lt;/programme&gt;
  &lt;/radio&gt;
  </code></pre>
  
  <p>with many instances of <strong>programme</strong> and <strong>channel</strong>. I try to deserialize it into this c# object but I get a null instead of object: </p>
  
  <pre><code>[XmlRoot("radio")]
  public sealed class radio
  {
      [XmlRoot("channel")]
      public sealed class channel
      {
          [XmlAttribute("id")]
          public string id { get; set; }
  
          [XmlElement("display-name")]
          public string displayName { get; set; }
  
          [XmlElement("icon")]
          public string icon { get; set; }
  
          public channel()
          {    
          }
      }
  
      [XmlRoot("programme")]
      public sealed class programme
      {
          [XmlAttribute("channel")]
          public string channel { get; set; }
  
          [XmlAttribute("start")]
          public string start { get; set; }
  
          [XmlAttribute("stop")]
          public string stop { get; set; }
  
          [XmlAttribute("duration")]
          public string duration { get; set; }
  
          [XmlElement("title")]
          public string title { get; set; }
  
          [XmlElement("desc")]
          public string desc { get; set; }
  
          [XmlElement("category")]
          public string category { get; set; }
  
          [XmlElement("date")]
          public string date { get; set; }
  
          public programme()
          {
          }
      }
  
      [XmlArray]
      public channel[] channels { get; set; }
  
      [XmlArray]
      public programme[] programmes { get; set; }
  
      public radio()
      {
          channels = null;
          programmes = null;
      }
  
      public static radio FromXmlString(string xmlString)
      {
          var reader = new StringReader(xmlString);
          var serializer = new XmlSerializer(typeof(radio));
          var instance = (radio)serializer.Deserialize(reader);
  
          return instance;
      }
  }
  </code></pre>
  
  <p>What am I doing wrong and what would be the proper xml object class?</p>