Use this:
XContainer.Elements Method (System.Xml.Linq) | Microsoft Docs[
^] instead of Descendants if you are only looking for one level.
Something else:
IEnumerable<xelement> de = from el in xdoc.Descendants() select el;
doesn't add anything besides making the code look more complex. It basically says "Make a collection b that is containing all items in collection a". Why not just use collection a?
So you can delete the line, and instead loop on:
foreach (XElement el in xdoc.Descendants())
or more likely what you want in this specific case:
foreach (XElement el in xdoc.Root.Elements())