    # File lib/nokogiri/xml/node.rb, line 680
          def namespace= ns
            return set_namespace(ns) unless ns

            unless Nokogiri::XML::Namespace === ns
              raise TypeError, "#{ns.class} can't be coerced into Nokogiri::XML::Namespace"
            end
            if ns.document != document
              raise ArgumentError, 'namespace must be declared on the same document'
            end

            set_namespace ns
          end