title: Parsing XML with Linq with multiple descendants
body: <p>I have a probleme to parse multiple XML field</p>
  
  <p>This a the style of the XML :</p>
  
  <pre><code>&lt;students&gt;
    &lt;student&gt;
      &lt;student_id&gt;1&lt;/student_id&gt;
      &lt;student_name&gt;Mike&lt;/student_name&gt;
      &lt;subjects&gt;
        &lt;subject&gt;
          &lt;school_subject&gt;History&lt;/school_subject&gt;
        &lt;/subject&gt;
        &lt;subject&gt;
          &lt;school_subject&gt;Maths&lt;/school_subject&gt;
        &lt;/subject&gt;
        &lt;subject&gt;
          &lt;school_subject&gt;English&lt;/school_subject&gt;
        &lt;/subject&gt;
      &lt;/subjects&gt;
    &lt;/student&gt;
    &lt;student&gt;
      ...
    &lt;/student&gt;
  &lt;/students&gt;
  </code></pre>
  
  <p>I can parse it for the simple field like student_id and student_name but when there are multiple repetition of a same field I don't know how to do :/
  This is my source code of the parsing.</p>
  
  <p>I made two classes : </p>
  
  <ul>
  <li>Subject containing the name of the school subject</li>
  <li>student containing id and name and a list of class Subject.</li>
  </ul>
  
  <p>Now the source code :</p>
  
  <pre><code>List&lt;Student&gt; L1 = new List&lt;Student&gt;();
  
  XDocument doc = XDocument.Load(s);
  var q = from b in doc.Descendants("student")
  select new
  {
      s_id = (string)b.Element("student_id"),
      s_name = (string)b.Element("student_name"),
      s_subject = (Subject)b.Elements("school_subject")
  };
  foreach (var p in q)
  {
      L1.Add(new Student() { id = p.s_id, name = p.s_name, subject = p.s_subject });
  }
  listBox1.ItemsSource = L1;
  </code></pre>
  
  <p>Thanks for reading and sorry for my very bad english.</p>