    # File lib/nokogiri/xml/node.rb, line 557
          def namespaces
            Hash[*namespace_scopes.map { |nd|
              key = ['xmlns', nd.prefix].compact.join(':')
              if RUBY_VERSION >= '1.9' && document.encoding
                begin
                  key.force_encoding document.encoding
                rescue ArgumentError
                end
              end
              [key, nd.href]
            }.flatten]
          end