"<xsl:template match=\"/node1/subnode2/text()\">" +
"<xsl:value-of select=\"$param1\"/>" +
"</xsl:template>" +
"</xsl:stylesheet>";
XsltTransformer transformer = new XsltTransformer();
transformer.setMuleContext(muleContext);
transformer.setReturnDataType(DataTypeFactory.STRING);
transformer.setMuleContext(muleContext);
// set stylesheet
transformer.setXslt(xsl);
// set parameter
Map params = new HashMap();
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);