Suppose I have this (simplified):
You're almost there. Simply use:
//form[@id='myform']//input[@type='submit']
The //
shortcut can also be used inside an expression.
If you are using the XmlDocument and XmlNode.
Say:
XmlNode f = root.SelectSingleNode("//form[@id='myform']");
Use:
XmlNode s = f.SelectSingleNode(".//input[@type='submit']");
It depends on the tool that you use. But .// will select any child, any depth from a reference node.
Also, you can do it with css selectors:
form#myform input[type='submit']
space beween elements in css elector means searching input[type='submit'] that elements at any depth of parent form#myform element
//form/descendant::input[@type='submit']