I have some XML I'm having trouble processing with XPath. I can't seem to get the values I'm looking for. The XML is structured like this:
<Group>
<Menu>
<Name>Top Menu</Name>
<Document>
<DocName>Readme.txt</DocName>
</Document>
<Menu>
<Name>Sub Menu</Name>
<Document>
<DocName>Manual.pdf</DocName>
</Document>
<Document>
<DocName>UserGuide.pdf</DocName>
</Document>
</Menu>
</Menu>
</Group>
Given the menu name, I want to get back a list of DocumentNodes in the menu. For example, given "Sub Menu", I'd like to get back the two Document nodes for Manual.pdf and UserGuide.pdf.
Currently, I'm pulling this information using code that loops through the children, but, I'd rather just pull it up directly using XPath, but my skills with it are weak.
(And before you ask, I cannot restructure the XML. It's provided to me this way.)
Any thoughts?