require 'rubygems' require 'xml/libxml' doc = XML::Parser.string(< Books Stores O'Reilly Book Content Dummy Book tag:oreilly.com,2007:172049 2007-01-13T00:25:07Z 2007-01-13T00:25:07Z EOFEED ).parse; nil doc.class n1 = doc.find("*").to_a.first n1.path n2 = doc.find(n1.path).to_a.first # huh? n2 # bah! namespace = "http://www.w3.org/2005/Atom" doc.find("*", namespace).each {|node| puts "PATH " + node.path; puts "CONTENT " + node.content[0..10] doc.find(node.path, namespace).each {|alt_node| # this'll never be run puts "REAL_PATH " + alt_node.path; puts "REAL CONTENT " + alt_node.content[0..10] } }