XMLConsumer consumer = new ContentHandlerWrapper(handler);
ProcessingPipeline pipeline = cocoon.buildPipeline(env);
CocoonComponentManager.enterEnvironment(env, cocoon.getComponentManager(), cocoon);
try {
pipeline.prepareInternal(env);
pipeline.process(env, consumer);
} finally {
CocoonComponentManager.leaveEnvironment();
}
// if we get here, the page was created :-)