You need a DTD to set which attribute on the elements will contain a unique identifier. XML does not imply that the id attribute should be considered as a unique identifier for an element.
In general, the "unDTDed" XML getElementById is not very useful. In most cases, the structure of the XML file being processed is understood (for example, the root element is called books , which contains a series of book elements), so a typical access would look something like this: -
XmlElement book = (XmlElement)doc.DocumentElement.SelectSingleNode("book[@ID='U1_000']");
If you really don't know the XML structure and / or the element tag name, then the brute force search described in Marcs answer will work.
AnthonyWJones
source share