split out xml generation from form submission