title: How to Serialize to a "Collection with an Attribute" Using the XML Serializer
body: <p>I have this model:</p>
  
  <pre><code>[XmlArray(ElementName = "Listing")]
  [XmlArrayItem(ElementName = "Classification")]
  public List&lt;Classification&gt; classifications { get; set; }
  
  [XmlRoot("Listing")]
  public class Classification
  {
       [XmlAttribute("Name")]
       public string name { get; set; }
  
       [XmlText]
       public string Value { get; set; }
  }
  </code></pre>
  
  <p>That gives me this:</p>
  
  <pre><code>&lt;Listing&gt;
  &lt;Classification Name="Location"&gt;AsiaPacific&lt;/Classification&gt;
  &lt;/Listing&gt;
  </code></pre>
  
  <p>How should I modify my class to get this:</p>
  
  <pre><code>&lt;Listing reference = "MyReference"&gt;
  &lt;Classification Name="Location"&gt;AsiaPacific&lt;/Classification&gt;
  &lt;/Listing&gt;
  </code></pre>