StringResult result = new StringResult();
try {
marshaller.marshal(payload, result);
} catch (XmlMappingException e) {
throw new CitrusRuntimeException("Failed to marshal object graph for message payload", e);
} catch (IOException e) {
throw new CitrusRuntimeException("Failed to marshal object graph for message payload", e);
}
if (action.getMessageBuilder() != null && action.getMessageBuilder() instanceof PayloadTemplateMessageBuilder) {
((PayloadTemplateMessageBuilder)action.getMessageBuilder()).setPayloadData(result.toString());
} else {