code: public static Document parseMessagePayload(String messagePayload) {
          LSParser parser = configurer.createLSParser();
          LSInput receivedInput = configurer.createLSInput();
          try {
              Charset charset = getTargetCharset(messagePayload);
              receivedInput.setByteStream(new ByteArrayInputStream(messagePayload.trim().getBytes(charset)));
              receivedInput.setEncoding(charset.displayName());
          } catch(UnsupportedEncodingException e) {
              throw new CitrusRuntimeException(e);
          }
  
          return parser.parse(receivedInput);
      }
docs: Parse message payload with DOM implementation.
  @param messagePayload
  @throws CitrusRuntimeException
  @return DOM document.