title: Serialize Property as Xml Attribute in Element
body: <p>I have the following class:</p>
  
  <pre><code>[Serializable]
  public class SomeModel
  {
      [XmlElement("SomeStringElementName")]
      public string SomeString { get; set; }
  
      [XmlElement("SomeInfoElementName")]
      public int SomeInfo { get; set; }
  }
  </code></pre>
  
  <p>Which (when populated with some test data) and Serialized using XmlSerializer.Serialize() results in the following XML:</p>
  
  <pre><code>&lt;SomeModel&gt;
    &lt;SomeStringElementName&gt;testData&lt;/SomeStringElementName&gt;
    &lt;SomeInfoElementName&gt;5&lt;/SomeInfoElementName&gt;
  &lt;/SomeModel&gt;
  </code></pre>
  
  <p>What I need to have is:</p>
  
  <pre><code>&lt;SomeModel&gt;
    &lt;SomeStringElementName Value="testData" /&gt;
    &lt;SomeInfoElementName Value="5" /&gt;
  &lt;/SomeModel&gt;
  </code></pre>
  
  <p>Is there a way to specify this as attributes without writing my own custom serialization code?</p>