title: Decorate Xml ClassName on XmlSerializer
body: <p>I need to obtain the following xml:</p>
  
  <pre><code>&lt;request id="1"&gt;
    &lt;login&gt;
      &lt;username&gt;username&lt;/username&gt;
      &lt;password&gt;password&lt;/password&gt;
    &lt;/login&gt;
  &lt;/request&gt;
  </code></pre>
  
  <p>but the middle xml can change to another type of request like</p>
  
  <pre><code>&lt;request id="1"&gt;
    &lt;logout /&gt;
  &lt;/request&gt;
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code>[XmlRootAttribute(ElementName = "request", Namespace = "", IsNullable = false)]
  public class Request&lt;T&gt;
  {
      [XmlAttributeAttribute(AttributeName = "id", Namespace = "")]
      public string Id { get; set; }
  
      public T Content { get; set; }
  }
  
  [XmlTypeAttribute(TypeName = "login", AnonymousType = true)]
  public class LoginRequest
  {
      [XmlElementAttribute(ElementName = "username", Namespace = "")]
      public string Username;
  
      [XmlElementAttribute(ElementName = "password", Namespace = "")]
      public string Password;
  }
  
  [XmlTypeAttribute(TypeName = "logout", AnonymousType = true)]
  public class LogoutRequest
  {
  }
  </code></pre>
  
  <p>But when I serialize the object using</p>
  
  <pre><code>var serializer = new XmlSerializer(typeof(Request&lt;LoginRequest&gt;));
  </code></pre>
  
  <p>I got the following xml:</p>
  
  <pre><code>&lt;request id="1"&gt;
    &lt;Content&gt;
      &lt;username&gt;username&lt;/username&gt;
      &lt;password&gt;password&lt;/password&gt;
    &lt;/Content&gt;
  &lt;/request&gt;
  </code></pre>
  
  <p>How do I rename the tag Content to login or logout?</p>
  
  <p>Thanks a lot</p>