The WebSphere Integration Developer InfoCenter contains a section on creating your own mediation primitive to sit on the palette alongside the standard set of primitives. If you prefer learning by example, then Russ Butek has a developerWorks article out that leads you through the steps to create and deploy a simple primitive that writes all or part of a Service Message Object out to the console. (A handy primitive to have in your toolkit in its own right.)