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