Search code examples
c#xmllinqxelement

Index of Child XElement


Given an XElement is there a way to find out that element's index within the parent container?

I know there must be but I just can't figure it out!

Thanks!


Solution

  • Try e.ElementsBeforeSelf().Count()