title: How can I loop Through all the elements in .select statement in Linq
body: <p>I am trying to Print "Title of the Book , AuthorNames " (Some Books have more than one author)
  Below Linq code is printing only first author. How can I print all the authors associated with a book?</p>
  
  <pre><code> List&lt;string&gt; books = docs.Descendants(name)
  
     .Select(x =&gt; new {
         Title = (string)x.Element(ns+"TITLE"),
             Author = x.Element(ns+"INTEL_AUTH")
          })
  .Select(x =&gt; new {
             Title = x.Title,
             FirstName = (string) x.Author.Element(ns+"FNAME"),
             MiddleInitial = (string) x.Author.Element(ns+"MNAME"),
             LastName = (string) x.Author.Element(ns+"LNAME"),
          })
  .Select(x =&gt; string.Format("{0}: {1} {2} {3}",
                             x.Title,
                             x.FirstName, x.MiddleInitial, x.LastName))
  .ToList();
  
  for (int i = 0; i &lt; books.Count; i++)
  {       
     Response.Write("--" + books[i] + "&lt;BR /&gt;" );      
  }
  </code></pre>
  
  <p><strong>XML</strong>
  Here is the xml code.
       
      
      
       TEST 1 
      
        JOHN
      
       DOE
      
      
      JOHN
       
       SKEET
       </p>
  
  <pre><code> &lt;INTEL_AUTH ID="10"&gt;
   &lt;FNAME&gt;JO&lt;/FNAME&gt;
   &lt;MNAME&gt;&lt;/MNAME&gt;
   &lt;LNAME&gt;JO&lt;/LNAME&gt;
   &lt;INTEL_AUTH&gt;
   &lt;/INTEL&gt;
  
    &lt;INTEL&gt;
    &lt;TILE&gt; LEARNING LINQ&lt;/TITLE&gt;
    &lt;INTEL_AUTH ID="2"&gt;
    &lt;FNAME&gt; SHELLY&lt;/FNAME&gt;
    &lt;MNAME&gt;&lt;/MNAME&gt;
    &lt;LNAME&gt;SHELLY&lt;/LNAME&gt;
    &lt;INTEL_AUTH iD="3"&gt;
    &lt;FNAME&gt;CHRIS&lt;/FNAME&gt;
    &lt;MNAME&gt;&lt;/MNAME&gt;
    &lt;LNAME&gt;MADISON&lt;/LNAME&gt;
    &lt;/INTEL_AUTH&gt;
  
  
    &lt;/INTEL&gt;
    &lt;/RECORD&gt;
    &lt;/XML&gt;
  </code></pre>
  
  <p>I WANT THE OUTPUT TO BE DISPLAYED LIKE : (TITLE) : ALL AUTHORS WHO WROTE THAT BOOK</p>
  
  <p>TEST 1 : JOHN DOE , JOHN SKEET , JO JO
  LEARNING LINQ : SHELLY SHELLY , CHRIS MADISON</p>