# File htree/traverse.rb, line 103
    def filter_with_path(&block)
      children = []
      self.each_with_path('') {|c, path|
        if yield c, path
          if Elem === c
            children << c.filter_with_path(path, &block)
          else
            children << c
          end
        end
      }
      Doc.new(children)
    end