From: Phrogz Date: 2007-03-19T23:05:14+09:00 Subject: Re: Pulling text from elements with REXML On Mar 19, 5:38 am, Paul Willis wrote: > root.elements["NewsItem/NewsComponent/NewsComponent[1]/NewsComponent/Conten tItem/DataContent/nitf/body/body.head/hedline/hl1"] > > Gives me... > > Blueprint to cut emissions unveiled > > Is there an easy way (ie something in REXML) to pull just the text > without the containers and . require 'rexml/document' doc = REXML::Document.new("hello world") p REXML::XPath.first( doc, '/root/kid/text()' ) #=> "hello world"