<p>Any XPath like /NodeName/position() would give you the position of the Node w.r.t it's parent node.</p>

<p>There is no method on the XElement (Linq to XML) object that can get the position of the Element. Is there?</p>

```
```
static int Position(this XNode node) {
  var position = 0;
  foreach(var n in node.Parent.Nodes()) {
    if(n == node) {
      return position;
    }
    position++;
  }
  return -1;
}
```
```