class REXML::Element def find_attribute(attr_name, ns=nil) if !ns return self.attributes[attr_name] else ns_prefix = self.namespaces.index(ns) if ns_prefix return self.attributes["#{ns_prefix}:#{attr_name}"] else return nil end end end end