'Process all the nodes in the document.
Returns a tuple of the resulting nodes, a list of error strings, and
a number indictating how many nodes have changed.'

def process(self, nodes):

    new_nodes = []
    for node in nodes:
        result = self.process_node(node)
        if isinstance(result, (tuple, list)):
            new_nodes.extend(result)
        else:
            new_nodes.append(result)
    return (new_nodes, self.errors, self.nodes_changed)
