Let's say this XML is stored in an XmlDocument
called doc
.
XmlElement docRoot = doc.DocumentElement;
XmlNode cookingNode = docRoot.SelectSingleNode("./book[@category='COOKING']");
I tested this and added this line to verify:
Console.WriteLine(cookingNode.OuterXml);
Here was the output:
Everyday Italian Giada
De Laurentiis 2005 30.00