Google

def attribute_of element, attribute att_decl = find do |child| child.kind_of? AttlistDecl and child.element == element and child.include? attribute end return nil unless att_decl att_decl[attribute] end