"<subnode2>" + param + "</subnode2>" +
"</node1>";
String xsl = someXslText();
XsltTransformer transformer = new XsltTransformer();
transformer.setMuleContext(muleContext);
transformer.setReturnDataType(DataTypeFactory.STRING);
transformer.setMuleContext(muleContext);
// set stylesheet
transformer.setXslt(xsl);
// set parameter
Map<String, Object> params = new HashMap<String, Object>();
params.put("param1", "#[header:myproperty]");
transformer.setContextProperties(params);
// init transformer
transformer.initialise();
MuleMessage message = new DefaultMuleMessage(xml, muleContext);
message.setOutboundProperty("myproperty", param);
// do transformation
String transformerResult = (String) transformer.transform(message);
// remove doc type and CRLFs
transformerResult = transformerResult.substring(transformerResult.indexOf("?>") + 2);
assertTrue(transformerResult.indexOf(expectedTransformedxml) > -1);