title: XML serialization of enums
body: <p>I have problems with serializing enum values.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
  public class REQUEST
  {
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string ID;
  
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public REQUESTTypetype Type;
  }
  
  public enum REQUESTTypetype
  {
      One,
      Two,
      Three,
      Four,
  }
  
  ...
  
  REQUEST request = new REQUEST();
  request.ID = "1234";
  request.Type = REQUESTTypetype.One;
  
  XmlDocument doc = new XmlDocument();
  MemoryStream ms = new MemoryStream();
  StreamWriter sw = new StreamWriter(ms);
  XmlSerializer xs = new XmlSerializer(typeof(REQUEST));
  xs.Serialize(sw, request_group);
  ms.Position = 0;
  doc.Load(ms);
  TestWriteXml(doc, @"C:\xml_test.xml");
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
  &lt;REQUEST ID="1234" /&gt;
  </code></pre>
  
  <p>Why the enum is not serialized? I use .NET Framework 2.0.</p>
  
  <p>Thank you.</p>