require 'rexml/document' require 'open-uri' include REXML require 'expatparser' REXML::Parsers.registry[:default] = REXML::Parsers.registry[:expat] nsmap = { 'atom'=>'http://www.w3.org/2005/Atom', 'xhtml'=>'http://www.w3.org/1999/xhtml' } source = open('http://www.tbray.org/ongoing/ongoing.atom').read doc = Document.new(source) XPath.each(doc, '//atom:title', nsmap) do |title| puts title.text end