title: xml serialization - remove namespace
body: <p>I am serializing an object using c#. I am getting result in this format given bellow</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;
  &lt;Users xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
      &lt;Users&gt;
          &lt;User Id=&quot;11005477969327&quot; CreateDate=&quot;06/03/2011&quot; LastSendDate=&quot;1/1/0001&quot; /&gt;
          &lt;User Id=&quot;11034688201594&quot; CreateDate=&quot;04/22/2012&quot; LastSendDate=&quot;1/1/0001&quot; /&gt;
      &lt;Users 
  &lt;/User&gt;
  
      
  </code></pre>
  <p>But I want result in this format.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;
  &lt;Users&gt;
    &lt;User Id=&quot;11005477969327&quot; SendDate=&quot;1/1/0001&quot; NextSendDate=&quot;2/7/2012 11:13:30 AM&quot; /&gt;
    &lt;User Id=&quot;11034688201594&quot; SendDate=&quot;1/1/0001&quot; NextSendDate=&quot;2/7/2012 11:13:30 AM&quot; /&gt;
  &lt;/Users&gt;
  </code></pre>
  <p>Here's my code:</p>
  <pre><code>public class Users
  {
      [XmlArray(&quot;Users&quot;)]
      public List&lt;User&gt; ListData { get; set; }
  
      public string GetXML()
      {
          System.IO.MemoryStream ms = new System.IO.MemoryStream();
  
          XmlSerializer sr = new XmlSerializer(typeof(Users));
          sr.Serialize(ms, this);
  
          ms.Position = 0;
          return System.Text.Encoding.UTF8.GetString(ms.ToArray());
      }
  }
  
  public class User
  {
      [XmlAttribute(&quot;Id&quot;)]
      public Int64 UserId { get; set; }
  
      [XmlAttribute(&quot;CreateDate&quot;)]
      public string CreateDate { get; set; }
  
      [XmlAttribute(&quot;LastSendDate&quot;)]
      public string LastSendDate { get; set; }
  }
  </code></pre>