Output XML to File

How about:

puts User.find_by_id(params[:id]).to_xml