How to get first level of children by LINQ How to get first level of children by LINQ asp.net asp.net

How to get first level of children by LINQ


Just document.Root.Elements() should work.

Basically Descendants() recurses, whereas Elements() only gets direct children.