title: XML serialization and DefaultValue("") related problem in c#
body: <p>my class property has default value which will be serialize.</p>
  
  <pre><code>public class DeclaredValue
  {
      [XmlElement(ElementName = "Amount", DataType = "double", IsNullable = false), DefaultValue(999)]
      public double Amount { get; set; }
  
      [XmlElement(ElementName = "Reference2", DataType = "string", IsNullable = false), DefaultValue("")]
      public string Reference2 { get; set; }
  }
  </code></pre>
  
  <p>so we create instance of DeclaredValue class and provide value for Reference2 property and  do not assign anything for Amount. so when we serialize the class DeclaredValue then no tag found for amount in my xml. i mention default value for amount "999" then why it does not work in serialization. i want that if do not assign anything for amount then amoun tag should be there in my xml with default value.</p>
  
  <p>to do this what way i need to decorate the amount property that it always comes with default value in xml after serialization if user do not assign anything to this property.</p>
  
  <p>please guide me what i need to change in the code to get my desired output.</p>