I am doing the following query on an XDocument. The last level .Descendants("Instance") yields a list of XElements of the form:
<Instance>filepath1</Instance>
<Instance>filepath2</Instance>
<Instance>filepath3</Instance>
<Instance>filepath4</Instance>
Query
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 can I store the values filepath1, filepath2.. in the List<string>?
Select(x=>x.Value)?