title: How to exclude null properties when using XmlSerializer
body: <p>I'm serializing a class like this</p>
  
  <pre><code>public MyClass
  {
      public int? a { get; set; }
      public int? b { get; set; }
      public int? c { get; set; }
  }
  </code></pre>
  
  <p>All of the types are nullable because I want minimal data stored when serializing an object of this type.  However, when it is serialized with only "a" populated, I get the following xml</p>
  
  <pre><code>&lt;MyClass ...&gt;
      &lt;a&gt;3&lt;/a&gt;
      &lt;b xsi:nil="true" /&gt;
      &lt;c xsi:nil="true" /&gt;
  &lt;/MyClass&gt;
  </code></pre>
  
  <p>How do I set this up to only get xml for the non null properties?  The desired output would be</p>
  
  <pre><code>&lt;MyClass ...&gt;
      &lt;a&gt;3&lt;/a&gt;
  &lt;/MyClass&gt;
  </code></pre>
  
  <p>I want to exclude these null values because there will be several properties and this is getting stored in a database (yeah, thats not my call) so I want to keep the unused data minimal.</p>