docs: public void extractVariables(Message message, TestContext context) {
          if (CollectionUtils.isEmpty(xPathExpressions)) {return;}
  
          if (log.isDebugEnabled()) {
              log.debug("Reading XML elements with XPath");
          }
          
          NamespaceContext nsContext = context.getNamespaceContextBuilder().buildContext(message, namespaces);
  
          for (Entry<String, String> entry : xPathExpressions.entrySet()) {
              String pathExpression = context.replaceDynamicContentInString(entry.getKey());
              String variableName = entry.getValue();
  
              if (log.isDebugEnabled()) {
                  log.debug("Evaluating XPath expression: " + pathExpression);
              }
              
              Document doc = XMLUtils.parseMessagePayload(message.getPayload(String.class));
              
              if (XPathUtils.isXPathExpression(pathExpression)) {
                  XPathExpressionResult resultType = XPathExpressionResult.fromString(pathExpression, XPathExpressionResult.STRING);
                  pathExpression = XPathExpressionResult.cutOffPrefix(pathExpression);
                  
                  Object value = XPathUtils.evaluate(doc, pathExpression, nsContext, resultType);
  
                  if (value == null) {
                      throw new CitrusRuntimeException("Not able to find value for expression: " + pathExpression);
                  }
  
                  if (value instanceof List) {
                      value = StringUtils.arrayToCommaDelimitedString(((List)value).toArray(new String[((List)value).size()]));
                  }
                  
                  context.setVariable(variableName, value);
              } else {
                  Node node = XMLUtils.findNodeByName(doc, pathExpression);
  
                  if (node == null) {
                      throw new UnknownElementException("No element found for expression" + pathExpression);
                  }
  
                  if (node.getNodeType() == Node.ELEMENT_NODE) {
                      if (node.getFirstChild() != null) {
                          context.setVariable(xPathExpressions.get(pathExpression), node.getFirstChild().getNodeValue());
                      } else {
                          context.setVariable(xPathExpressions.get(pathExpression), "");
                      }
                  } else {
                      context.setVariable(xPathExpressions.get(pathExpression), node.getNodeValue());
                  }
              }
          }
      }