I'd go with om.DomNode.selectByPath() as per Jeff's answer. I'd just add that the first part of the XPath syntax can include * to indicate look at all nodes so you may want something like ...
FUNCTION find_by_name(name)
DEFINE name STRING
DEFINE r,n om.DomNode
DEFINE nl om.NodeList
DEFINE i INTEGER
LET r= ui.Interface.getRootNode()
LET nl = r.selectByPath(SFMT("//*[@name=\"%1\"]", name))
FOR i = 1 TO nl.getLength()
LET n = nl.item(i)
DISPLAY SFMT("Found node with name=%1 of type %2 and id %3", name, n.getTagName(), n.getId())
END FOR
END FUNCTION
... the other thing to be aware of. The om class is a cut-down set of routines designed to help with manipulating the user interface DOM tree. If you are dealing with an XML file and not the user interface DOM tree, you may find the XML package has more functionality
https://4js.com/online_documentation/fjs-fgl-manual-html/#c_gws_XML_Library_001.html