def traverse(element, visitor, context = Visitor::Context.new)
      ns_bindings = namespace_bindings_from_defs(element.namespace_definitions)
      context.ns_stack.push(ns_bindings)

      eelement, eattrs = explode_element(element)

      begin
        visitor.element(context, eelement, eattrs, ns_bindings) do
          element.children.each do |child|
            if child.element?
              traverse(child, visitor, context)
            elsif child.text?
              visitor.text(context, child.content)
            else
              Rsxml.log{|logger| logger.warn("unknown Nokogiri Node type: #{child.inspect}")}
            end
          end
        end
      ensure
        context.ns_stack.pop
      end

      visitor
    end
def traverse(element, visitor, context = Visitor::Context.new)
      ns_bindings = namespace_bindings_from_defs(element.namespace_definitions)
      context.ns_stack.push(ns_bindings)

      eelement, eattrs = explode_element(element)

      begin
        visitor.element(context, eelement, eattrs, ns_bindings) do
          element.children.each do |child|
            if child.element?
              traverse(child, visitor, context)
            elsif child.text?
              visitor.text(context, child.content)
            else
              Rsxml.log{|logger| logger.warn("unknown Nokogiri Node type: #{child.inspect}")}
            end
          end
        end
      ensure
        context.ns_stack.pop
      end

      visitor
    end
pre-order traversal of the Nokogiri Nodes, calling methods on
 the visitor with each Node