XML based templated generation