I think it is safer/better to use something along the lines of `doc.root.namespace_definitions.select {|ns| ns.prefix =~ /v[0-9]+/}` or `doc.namespaces.keys.select { |ns| ns =~ /xmlns:v[0-9]+/ }`.