xml from a var

If I form and/or build up xml in a model or controller and assign it
to a var how do I get a page to display the xml?

render :xml => {:name => “David”}.to_xml

Renders ‘David’

should be the last line in the action

No I am doing this:

def assert_xml_message(type,msg)
x = gen_basic_xml
x.response do
x.tag!(type) do
x.message msg

x is a var with xml.

Make x variable class attribute by naming it @x and use next code in your View :
<%= @x %>

Sorry, i mean object attribute.