title: Prevent self closing tags in XmlSerializer when no data is present
body: <p>When I serialize the value : If there is no value present in for data then it's coming like below format. </p>
  
  <pre><code>  &lt;Note&gt;
          &lt;Type&gt;Acknowledged by PPS&lt;/Type&gt;
          &lt;Data /&gt;
    &lt;/Note&gt;
  </code></pre>
  
  <p><strong>But what I want xml data in below format:</strong></p>
  
  <pre><code>  &lt;Note&gt;
          &lt;Type&gt;Acknowledged by PPS&lt;/Type&gt;
          &lt;Data&gt;&lt;/Data&gt;
    &lt;/Note&gt;
  </code></pre>
  
  <p>Code For this i have written :</p>
  
  <pre><code>[Serializable]
  public class Notes
  {
      [XmlElement("Type")]
      public string typeName { get; set; }
  
      [XmlElement("Data")]
      public string dataValue { get; set; }
  }
  </code></pre>
  
  <p>I am not able to figure out what to do for achieve data in below format if data has n't assign any value.</p>
  
  <pre><code>  &lt;Note&gt;
          &lt;Type&gt;Acknowledged by PPS&lt;/Type&gt;
          &lt;Data&gt;&lt;/Data&gt;
    &lt;/Note&gt;
  </code></pre>