Select XmlElement Help
-
hi all, i have to make a sample code using XmlDocument to select an XmlElement in this doc here is my file <Root> <node title="john"> </node> <node title="Sam"> <node title="Charle"> <node title="jim"></node> </node> </node> <node title="Sandra"> <node title="Amy"></node> </node> </Root> and here is the method i wanna make private static XmlElement findElement(string AttributeValue) { XmlDocument familyXml = new XmlDocument(); familyXml.Load("family.xml"); return siteMapXml.GetElementById(AttributeValue);// AttributeValue can be john, or jim ... } the problem that this method work only with ID attribute i notice wich supose that the ID is unique, how to select and XmlElement without using an xPath because i don't know the deep of my xml tree. thank you for help