title: How can I have a nullable enum serialized to an attribute
body: <p>I have a class that I need to deserialize from xml, and it has an enum property that is stored as an attribute in the xml.  Sometimes this attribute can be missing or have "" as a value.
  How can I have the serializer deal with making the BorrowerResidencyType property nullable? </p>
  
  <p>XML:</p>
  
  <pre><code>&lt;_RESIDENCE _StreetAddress="" _City="San Jose" _State="CA" BorrowerResidencyType="" /&gt;
  &lt;_RESIDENCE _StreetAddress="" _City="San Jose" _State="CA"  /&gt;
  </code></pre>
  
  <p>C#:</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute ( "System.Xml", "4.0.30319.17929" )]
  [System.SerializableAttribute ()]
  [System.Xml.Serialization.XmlTypeAttribute ( AnonymousType = true )]
  public enum _RESIDENCEBorrowerResidencyType
  {
  
      /// &lt;remarks/&gt;
      Current,
  
      /// &lt;remarks/&gt;
      Prior,
  }
  
  public class Test{
  public string StreetAddress{get;set;}
  public string City{get;set;}
  [System.Xml.Serialization.XmlAttributeAttribute ()]
  public _RESIDENCEBorrowerResidencyType BorrowerResidencyType{get;set;}
  }
  </code></pre>
  
  <p>Is there another library that would handle this situation more intelligently?</p>