title: C# serialize XML ArrayList to List<SelectListItem>
body: <p>I have an XML element that looks like this:</p>
  
  <pre><code>&lt;myThings&gt;
    &lt;Thing&gt;my first thing&lt;/Thing&gt;
    &lt;Thing&gt;my second thing&lt;/Thing&gt;
    &lt;Thing&gt;my third thing&lt;/Thing&gt;
  &lt;/myThings&gt;
  </code></pre>
  
  <p>In a ViewModel I have:</p>
  
  <pre><code>[XmlArray("myThings")]
  [XmlArrayItem("This")]
  public List&lt;String&gt; MyThings { get;set;}
  </code></pre>
  
  <p>When deserializing from the XML, I end up with a List of strings (MyThings).</p>
  
  <p>The problem is that I would like to have a list of "<a href="https://msdn.microsoft.com/en-us/library/system.web.mvc.selectlistitem(v=vs.118).aspx" rel="nofollow">SelectListItem</a>" instead of a simple list of strings.</p>
  
  <p>For each selectListItem in the list, I would like to use the string of a "Thing" (provided in the XML) for both the <code>Text</code> and the <code>Value</code> property.</p>
  
  <p>Any idea a convenient way of doing this?</p>
  
  <p>Thanks.</p>