use scope.ownerDocument.evaluate instead of document.evaluate