Hi,
you need to save this to a file - so instead of using a template, create the xml as output (REXML; ruby xml), and save it into a file with the File class.
you still have another option here if you want to use a builder (rxml) template. In your controller you can use render_to_string for calling the action associated to the rxml and get the output as a string. Then you can do exactly as Shai told you for saving it to a file
regards,
javier ramirez