title: Detect position of node in document using XDocument?
body: <p>I use the following LINQ request to parse XML file:</p>
  
  <pre><code>var names = from student in XDocument.Load(pwd, LoadOptions.SetLineInfo).Descendants(rootSection)
  
      Elements(rootNodeAttribute.Text)
      .Where(el =&gt; el.Attribute("name").Value == textBox2.Text).Elements(nodeValue).Elements("alt")
      let lineInfo = (IXmlLineInfo)student
       select new
       {
        ID = count++,
        Name = student.Value,
        Ref = student.Attribute("ref") != null ? student.Attribute("ref").Value : ""
      };
  </code></pre>
  
  <p>It works fine.</p>
  
  <p>How to define position elements that were found in <code>select new</code>?
  I want to bind position of each element to datagrid cell, that after I can update these nodes elements.</p>