code: def traverse(self, node):
          
          old_level = self.current_level
          if isinstance(node, nodes.section):
              if 'level' in node:
                  self.current_level = node['level']
          to_visit = []
          to_replace = []
          for c in node.children[:]:
              newnode = self.find_replace(c)
              if newnode is not None:
                  to_replace.append((c, newnode))
              else:
                  to_visit.append(c)
  
          for oldnode, newnodes in to_replace:
              node.replace(oldnode, newnodes)
  
          for child in to_visit:
              self.traverse(child)
          self.current_level = old_level
docs: Traverse the document tree rooted at node.
  
          node : docutil node
              current root node to traverse