    # File lib/nokogiri/xml/builder.rb, line 314
          def [] ns
            @ns = @parent.namespace_definitions.find { |x| x.prefix == ns.to_s }
            return self if @ns

            @parent.ancestors.each do |a|
              next if a == doc
              @ns = a.namespace_definitions.find { |x| x.prefix == ns.to_s }
              return self if @ns
            end

            raise ArgumentError, "Namespace #{ns} has not been defined"
          end