XmlFormattingMessageProcessor extends AbstractMessageProcessor { @Override public void processMessage(Message message, TestContext context) { message.setPayload(XMLUtils.prettyPrint(message.getPayload(String.class))); }  @Override void processMessage(Message message, TestContext context); @Override boolean supportsMessageType(String messageType);  }
@Test public void testProcessMessage() throws Exception { Message message = new DefaultMessage("<root>" + "<element attribute='attribute-value'>" + "<sub-element>text-value</sub-element>" + "</element>" + "</root>"); messageProcessor.process(message, context); Assert.assertTrue(message.getPayload(String.class).contains(System.lineSeparator())); }