title: Deserialize Xml with empty elements in C#
body: <p>Trying to deserialize some xml snippits from a vendor into objects.  The problem is that I'm getting an invalid format on every empy element tag.  I can deserialize the object no problem when all of the elements have values. Or the empty elements are ommitted.   </p>
  
  <p>Xml Snippit:  </p>
  
  <blockquote>
    <p>&lt;foo&gt;<br/>&lt;propOne&gt;1&lt;/propOne&gt;<br/>&lt;propTwo /&gt;<br/>&lt;/foo&gt;</p>
  </blockquote>
  
  <p>C# Class:</p>
  
  <pre><code>[Serialilbe()]     
  public class foo
  { 
     public foo(){}
     [XmlElementAttribute(IsNullable = true)]
     public int? propOne {get;set;} 
     [XmlElementAttribute(IsNullable = true)]
     public int? propTwo {get;set;}   
   }
  </code></pre>
  
  <p>Is there a setting on the class I can make to adjust the parsing?<BR/>
  or<BR/>
  Is there an easy way I can apply xsl to remove these elements?<BR/>
  or <BR/>
  Should I use regEx to remove the empty elements be fore desrializing?<BR/>
  or <BR/>
  an even better way?<BR/></p>