title: Can one use XmlAttributes to selectively XmlIgnore?
body: <p>I have a rather large class to serialize as Xml, and in order to reduce the wasted space would like to selectively XmlIgnore some of the class properties.  For example, one property in the class is assigned a value only one out of ten times or so, and if I code the serialization attribute as follows</p>
  
  <pre><code>[XmlAttribute]
  public String WorkClass
  {
      get { return _workClass; }
      set { _workClass = value; }
  }
  </code></pre>
  
  <p>If there is no value (most of the time) this is serialized over and over again as</p>
  
  <pre><code>WorkClass=""
  </code></pre>
  
  <p>Is there an option or attribute that would ignore the property for serialization if its value is empty, but not ignore it if it is not empty?</p>