title: Deserialize Xml Using Same Object With Different Element Name
body: <p>I have an EventType and Events classes to serialize/deserialize. In Xml for Events there is a XmlElement named "type". </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;events type="array"&gt;
     &lt;event&gt;
        &lt;where /&gt;
        &lt;project-users-can-edit type="boolean"&gt;false&lt;/project-users-can-edit&gt;
        &lt;description /&gt;
        &lt;attending-user-ids type="integer"&gt;164316&lt;/attending-user-ids&gt;
        &lt;notify-user-names&gt;Levent A.&lt;/notify-user-names&gt;
        &lt;attending-user-names&gt;Levent A.&lt;/attending-user-names&gt;
        &lt;status&gt;active&lt;/status&gt;
        &lt;owner&gt;
           &lt;first-name&gt;Levent&lt;/first-name&gt;
           &lt;id type="integer"&gt;164316&lt;/id&gt;
           &lt;last-name&gt;Arık&lt;/last-name&gt;
        &lt;/owner&gt;
        &lt;reminders type="array" /&gt;
        &lt;notify-user-ids type="integer"&gt;164316&lt;/notify-user-ids&gt;
        &lt;start&gt;2015-06-22T00:00&lt;/start&gt;
        &lt;repeat /&gt;
        &lt;all-day type="boolean"&gt;true&lt;/all-day&gt;
        &lt;id type="integer"&gt;608945&lt;/id&gt;
        &lt;end&gt;2015-06-22T23:59&lt;/end&gt;
        &lt;show-as-busy type="boolean"&gt;false&lt;/show-as-busy&gt;
        &lt;last-changed-on type="date"&gt;2015-07-08T09:20:37Z&lt;/last-changed-on&gt;
        &lt;privacy&gt;
           &lt;type&gt;company&lt;/type&gt;
        &lt;/privacy&gt;
        &lt;attendees-can-edit type="boolean"&gt;false&lt;/attendees-can-edit&gt;
        *&lt;type&gt;
           &lt;name&gt;Yıllık İzin&lt;/name&gt;
           &lt;id type="integer"&gt;104109&lt;/id&gt;
           &lt;color&gt;C65518&lt;/color&gt;
        &lt;/type&gt;*
        &lt;title&gt;Yıllıkİzin&lt;/title&gt;
     &lt;/event&gt;
  &lt;/events&gt;
  </code></pre>
  
  <p>But I also have an Xml with the list of EventTypes and with the different xmlelement name "eventtypes".</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;eventtypes type="array"&gt;
     &lt;eventtype&gt;
        &lt;name&gt;Diğer&lt;/name&gt;
        &lt;id type="integer"&gt;104285&lt;/id&gt;
        &lt;color&gt;E7C342&lt;/color&gt;
     &lt;/eventtype&gt;
     &lt;eventtype&gt;
        &lt;name&gt;Hastalık&lt;/name&gt;
        &lt;id type="integer"&gt;104284&lt;/id&gt;
        &lt;color&gt;399A5A&lt;/color&gt;
     &lt;/eventtype&gt;
     &lt;eventtype&gt;
        &lt;name&gt;Mazeret İzni&lt;/name&gt;
        &lt;id type="integer"&gt;104110&lt;/id&gt;
        &lt;color&gt;633C9C&lt;/color&gt;
     &lt;/eventtype&gt;
     &lt;eventtype&gt;
        &lt;name&gt;ResmiTatil&lt;/name&gt;
        &lt;id type="integer"&gt;104286&lt;/id&gt;
        &lt;color type="integer"&gt;737173&lt;/color&gt;
     &lt;/eventtype&gt;
     &lt;eventtype&gt;
        &lt;name&gt;Yıllık İzin&lt;/name&gt;
        &lt;id type="integer"&gt;104109&lt;/id&gt;
        &lt;color&gt;C65518&lt;/color&gt;
     &lt;/eventtype&gt;
  &lt;/eventtypes&gt;
  </code></pre>
  
  <p>I am using below class for this. But when I want to deserialize eventtypes Xml I have an exception because of title of XmlRoot attribute. </p>
  
  <pre><code>[Serializable]
  [XmlRoot("type")]
  public class EventType
  {
      public EventType()
      {
  
      }
      [XmlElement("color")]
      public string Color { get; set; }
      [XmlElement("id")]
      public string Id { get; set; }
      [XmlElement("name")]
      public string Name { get; set; }
  
  }
  </code></pre>
  
  <p>I know i can write 2 different classes with same properties. But i wonder if there is another way to do it.</p>