Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("translet-name", "CompiledXslt");
attributes.put("package-name", "org.apache.cocoon.sax");
Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
pipeline.addComponent(new XMLGenerator("<x></x>"));
pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt"), attributes));
pipeline.addComponent(new XMLSerializer());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
pipeline.setup(baos);