Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
pipe.addComponent(new XMLGenerator(input));
XMLEventFactory factory = XMLEventFactory.newInstance();
List<Attribute> atts = new ArrayList<Attribute>();
atts.add(factory.createAttribute("attribute", "bad"));
atts.add(factory.createAttribute("attribute", "good"));
List<Attribute> newAtts = new ArrayList<Attribute>();
StartElementAttributeModificationTransformer modifier = new StartElementAttributeModificationTransformer(
"anyelement", atts, newAtts);
pipe.addComponent(modifier);
pipe.addComponent(new XMLSerializer());