backtrack-xpath accepts a REXML::Element and returns the full XPath back to the root.
James Robertson
gem "backtrack-xpath", "~> 0.1.1"