title: Conditional xml serialization
body: <p>I have the following C# classes :</p>
  
  <pre><code>public class Books
  {
  
  public List&lt;Book&gt; BookList;
  
  }
  
  public class Book
  {
  
  public string Title;
  public string Description;
  public string Author;
  public string Publisher;
  
  }
  </code></pre>
  
  <p>How can I serialize this class into the following XML?</p>
  
  <pre><code>&lt;Books&gt;
    &lt;Book Title="t1" Description="d1"/&gt;
    &lt;Book Description="d2" Author="a2"/&gt;
    &lt;Book Title="t3" Author="a3" Publisher="p3"/&gt;
  &lt;/Books&gt;
  </code></pre>
  
  <p>I want the XML to have only those attributes whose values are not null/empty.
  For example: In the first Book element, author is blank, so it should not be present in the serialized XML.</p>