Описание тега document.evaluate

The document.evaluate() method enables XPath queries to be performed in JavaScript in Web applications and documents. It returns an XPathResult object, with methods that enable iterating through the set of nodes that match the document.evaluate() XPath query.

The MDN https://developer.mozilla.org/en-US/docs/Introduction_to_using_XPath_in_JavaScript article provides a very good overview of how to use document.evaluate() and how to work with XPathResult objects.

document.evaluate() and XPathResult are part of the DOM3 XPath standard.