title: XElement and List<T>
body: <p>I have a class that has the following properties:</p>
  
  <pre><code>public class Author {
    public string FirstName { get; set; }
    public string LastName { get; set; }
  }
  </code></pre>
  
  <p>Next, I have a List of Authors like so:</p>
  
  <pre><code>List&lt;Author&gt; authors = new List&lt;Author&gt; ();
  
  authors.add(
    new Author { 
      FirstName = "Steven",
      LastName = "King"
    });
  
  authors.add(
    new Author { 
      FirstName = "Homer",
      LastName = ""
    });
  </code></pre>
  
  <p>Now, I am trying to use Linq to XML in order to generate the XML representing my Authors List.</p>
  
  <pre><code>new XElement("Authors",
    new XElement("Author", 
      from na in this.Authors
      select new XElement("First", na.First)))
  </code></pre>
  
  <p>The block above does not generate the XML as I expect it to. What I get is:</p>
  
  <pre><code>&lt;Authors&gt;
    &lt;Author&gt;
      &lt;First&gt;Steven&lt;/First&gt;
      &lt;First&gt;Homer&lt;/First&gt;
    &lt;/Author&gt;
  &lt;Authors&gt;
  </code></pre>
  
  <p>What I want the XML output to look like is:</p>
  
  <pre><code>&lt;Authors&gt;
    &lt;Author&gt;
      &lt;First&gt;Steven&lt;/First&gt;
      &lt;Last&gt;King&lt;/Last&gt;
    &lt;/Author&gt;
    &lt;Author&gt;
      &lt;First&gt;Homer&lt;/First&gt;
      &lt;Last&gt;&lt;/Last&gt;
    &lt;/Author&gt;
  &lt;/Authors&gt;
  </code></pre>
  
  <p>Any help on how to get the XML to look as I need it to would be immensely appreciated!</p>