docs: public static Object evaluate(Node node, String xPathExpression,
              NamespaceContext nsContext, XPathExpressionResult resultType) {
          if (resultType.equals(XPathExpressionResult.NODE)) {
              Node resultNode = evaluateAsNode(node, xPathExpression, nsContext);
  
              if (resultNode.getNodeType() == Node.ELEMENT_NODE) {
                  if (resultNode.getFirstChild() != null) {
                      return resultNode.getFirstChild().getNodeValue();
                  } else {
                      return "";
                  }
              } else {
                  return resultNode.getNodeValue();
              }
          } else if (resultType.equals(XPathExpressionResult.NODESET)) {
              NodeList resultNodeList = evaluateAsNodeList(node, xPathExpression, nsContext);
  
              List<String> values = new ArrayList<>();
              for (int i = 0; i < resultNodeList.getLength(); i++) {
                  Node resultNode = resultNodeList.item(i);
  
                  if (resultNode.getNodeType() == Node.ELEMENT_NODE) {
                      if (resultNode.getFirstChild() != null) {
                          values.add(resultNode.getFirstChild().getNodeValue());
                      } else {
                          values.add("");
                      }
                  } else {
                      values.add(resultNode.getNodeValue());
                  }
              }
  
              return values;
          } else if (resultType.equals(XPathExpressionResult.STRING)) {
              return evaluateAsString(node, xPathExpression, nsContext);
          } else {
              Object result = evaluateAsObject(node, xPathExpression, nsContext, resultType.getAsQName());
  
              if (result == null) {
                  throw new CitrusRuntimeException("No result for XPath expression: '" + xPathExpression + "'");
              }
  
              if (resultType.equals(XPathExpressionResult.INTEGER)) {
                  return (int) Math.round((Double) result);
              }
  
              return result;
          }
      }