I have a big XML file and suppose I have following code:-
xdoc.Descendants("employee").Select(x => //rest of the code
Suppose I have multiple nodes in between, now I want to traverse back to root node with this element i.e. `x`
So currently doing it like this:-
x.Parent.Parent.Parent
I want to know is their any alternative to this? So that I can directly reach the root element?