I am making the following request on an XDocument . The last level .Descendants("Instance") gives a list of XElements of the form:
<Instance>filepath1</Instance> <Instance>filepath2</Instance> <Instance>filepath3</Instance> <Instance>filepath4</Instance>
Request
List<string> fileNames = xDoc.Descendants("Main") .FirstOrDefault() .Descendants("SecondLevel") .FirstOrDefault() .Descendants("Instance") .Select().ToList(); //this line is not correct. Need to get the instances node values as List<string>
How to save the values โโof filepath1 , filepath2 .. in List<string> ?
source share