As
Sergey Aleksandrovich Kryukov[
^] mentioned it depends on file size.
For small portion of data the difference measured in time of reading xml file is unnoticeable, even if you use
Linq to xml[
^].
Imagine, an xml structure looks like:
Root
--Level1
|--Level2
|--Level3
|--Level4
|--Level5
|--Level6
|--Level7
|--Level8
You want to get nodes (data) from node at
Level8
, so you can achieve that using query like this:
XDocument xdoc = XDocument.Load("fullfilename.xml");
var result = xdoc.Descendants("Level8")
.Descendants()
.Select(a=>a);
For further information, please see:
LINQ to XML[
^]
LINQ to XML Overview[
^]
Basic Queries (LINQ to XML)[
^]