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);