From: matt_neuburg@... (Matt Neuburg) Date: 2009-08-03T13:25:04+09:00 Subject: Re: : Can't find nodes using XPath, namespaces mess Aaron Patterson wrote: > You have an error in your XML below Thanks for spotting that. I must have removed the namespace and then put it back, to see if I could duplicate the OP's problems, and I must have put it back wrong. I wish libxml had just complained that my XML was bad... You're right; fixing the error, I can now duplicate the OP's problem in libxml (but not in REXML, as you also observed). And then I can solve it: s = < END require 'rubygems' require 'xml' doc = XML::Document.string(s) ns = {"xsi" => "urn:company:platform:foundation:configuration:defn:v1"} doc.find("//xsi:treenode['Root']/xsi:treenode", ns).each do |el| p el #=> end That is the desired sort of result, I take it. Notice that we register the namespace with the XPath engine and that we actually use the namescape in our XPath expression. m.