From: CD Baby Date: 2004-07-18T12:09:25+09:00 Subject: REXML : add text to element without temp variable? Say I'm trying to make this XML: Pink Floyd Dark Side of the Moon Right now I'm doing this: doc = Document.new music = doc.add_element 'music' artist = music.add_element 'artist' artist.text = 'Pink Floyd' album = music.add_element 'album' album.text = 'Dark Side of the Moon' QUESTION: Why create variables for artist and album? Shouldn't there be a way to add the text directly, without creating an in-between (and never used again) variable? Like this: music.add_element('album').text = 'Dark Side of the Moon' or this: music.add_element('album').text << Text.new('Dark Side of the Moon') Has anyone found a shortcut like this?