I have xml like this:
<A><B>test</B><B><B>test2</B></B><B><B><B>test2</B></B></B></A>
How can I get the level of each of these elements using linq for xml
test level = 1 test level 2 = 2 test level 3 = 3
I have no idea how many nodes there will be or how many levels there will be. I can write this as a recursive function, but I thought linq for xml might offer something better.
source share