Equivalent to your code:
XElement doc = XElement.Parse(xml);
IEnumerable<XElement> nodeList = doc.Descendants("Title");
You can call nodeList.ToList()if you need a discrete list, but if you just want to iterate, it IEnumerableshould be fine.
Edit: There are two ways to select nodes. Use Elements()if you need immediate children from node, or use Descendants()if you need all the children, no matter how deep they are.
source
share