Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
pipe.addComponent(new XMLGenerator(input));
XMLEventFactory factory = XMLEventFactory.newInstance();
pipe.addComponent(new CleaningTransformer());
pipe.addComponent(new SubSetTransformer("element", factory.createAttribute(new QName("attribute"), "second"),
factory.createAttribute(new QName("attribute"), "first")));
pipe.addComponent(new XMLSerializer());
pipe.setup(out);
pipe.execute();