XML_Document.get_xpath
get_xpathkey
Documentation
Get elements denoted by the given XPath key.
Arguments
key
: The XPath string to use to search for elements.
Examples
Get an element by xpath.
root = XML_Document.from_file test_file
root.get_xpath "/class/teacher[1]/firstname"
# => [XML_Document.from_text "<firstname>Alice</firstname>" . root_element]