Decoupling xml generation and publish action. Adding support to csv