Google

rv = @children.find { |item| item.kind_of? XMLDecl } rv = DECLARATION if rv.nil? rv end