findByXpath = (xpath, root = document) => {
  if (root !== document && xpath[0] !== ".") {
    xpath = `.${xpath}`;
  }

  return document.evaluate(xpath, root, null, XPathResult.ANY_TYPE, null).iterateNext();
}
Find a node by xpath
@param {string} xpath
@param {Node} root