From: Keith Fahlgren Date: 2007-03-20T00:38:16+09:00 Subject: Re: Pulling text from elements with REXML Hey, Two notes: 1. I always suggest the REXML::XPath methods over the others for people who grok XPath. 2. A REXML::XPath.* ... text() match will return a REXML::Text node, which may _not_ be what you want: $ irb --simple-prompt foo.rb >> require 'rexml/document' => true >> doc = REXML::Document.new("hello world") => ... >> REXML::XPath.first( doc, '/root/kid/text()' ) => "hello world" >> REXML::XPath.first( doc, '/root/kid/text()' ).class => REXML::Text Just something to be aware of (use .to_s if you want a string, as usual). HTH, Keith