docs: private static String evaluateAsString(String expression, Node node,
              XPath xpath) throws XPathExpressionException {
          if (isEmpty(node)) return null;
  
          if (!expression.equals(".")) {
              /*
               * If the expression being evaluated doesn't select a node, we want
               * to return null to distinguish between cases where a node isn't
               * present (which should be represented as null) and when a node is
               * present, but empty (which should be represented as the empty
               * string).
               *
               * We skip this test if the expression is "." since we've already
               * checked that the node exists.
               */
              if (asNode(expression, node, xpath) == null) return null;
          }
  
          String s = xpath.evaluate(expression, node);
  
          return s.trim();
      }