code: public String buildMessagePayload(TestContext context, String messageType) {
          try {    
              //construct control message payload
              String messagePayload = "";
              if (scriptResourcePath != null) {
                  messagePayload = buildMarkupBuilderScript(context.replaceDynamicContentInString(
                          FileUtils.readToString(FileUtils.getFileResource(scriptResourcePath, context), Charset.forName(context.resolveDynamicValue(scriptResourceCharset)))));
              } else if (scriptData != null) {
                  messagePayload = buildMarkupBuilderScript(context.replaceDynamicContentInString(scriptData));
              }
              
              return messagePayload;
          } catch (IOException e) {
              throw new CitrusRuntimeException("Failed to build control message payload", e);
          }
      }
docs: Build the control message from script code.