Originally Posted by doggy1982
what you woudl more do is..
that will get you the node with it, in the event there are multiple, you will want doc.SelectNodes... but basically you provide an xpath and it does it for you. If you are using c# and .net3, you can use XDocument, which looks like
XmlDocument doc = new XmlDocument()
XmlNode = doc.SelectNode("/journal[@id=2]/");
what that will do is get all the nodes named journal, then return an ienumerable for you to iterate through looking for the id=2. The first or default will return the first item, or if there are none, it returns null instead.
XDocument doc = XDocument.Load(XmlReader.Create(filepath));
XElement myelement = doc.Decentents(XName.Get("/journal")).Where(n=>n.Attribute(XName.Get("id")).Value == 2).FirstorDefault();