title: How to get the position (index in order) of an XML element using LINQ?
body: <p>I have XML exactly like this format:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;book&gt;
      &lt;chapter&gt;
          &lt;verse&gt;This is verse 1&lt;/verse&gt;
          &lt;verse&gt;This is verse 2&lt;/verse&gt;
          &lt;verse&gt;This is verse 3&lt;/verse&gt;
          &lt;verse&gt;This is verse 4&lt;/verse&gt;
      &lt;/chapter&gt;
      &lt;chapter&gt;
          &lt;verse&gt;This is verse 1&lt;/verse&gt;
          &lt;verse&gt;This is verse 2&lt;/verse&gt;
      &lt;/chapter&gt;
      &lt;chapter&gt;
          &lt;verse&gt;This is verse 1&lt;/verse&gt;
      &lt;/chapter&gt;
  &lt;/book&gt;
  </code></pre>
  
  <p>In C# using Linq, I need to be able to get the XML element of a specific position or index, based on the value of the function state.getChapterNumber(). For example, if the value were 4, I need to grab the 4th chapter element from the XML document.</p>
  
  <pre><code>XDocument book = XDocument.Load(string.Format("Translations/NWT/{0}.xml", state.BookName));
  var verses = from chapter in book.Decendants()
               where state.getChapterNumber() == (WHAT DO I PUT HERE TO MATCH THE VALUE??)
               from verse in chapter.Descendants("p").Elements()
               select new
               {
                   VerseNumber = verse.Attribute("n").Value,
                   Text = verse.Value,
                   LastVerseInParagraph = verse.Parent.Elements().LastOrDefault().Value,
                   FirstVerseInParagraph = verse.Parent.Elements().FirstOrDefault().Value
               };
  </code></pre>
  
  <p>Please help, this is really important and has been holding me back for days. All I want to do is be able to get verses from any chapter set that I choose in the book.</p>