'Closes open elements, up to (and including) the element identified
by the given identifier.
Parameters
id : int
Element identifier, as returned by the `start` method.'

def close(self, id):

    while (len(self._tags) > id):
        self.end()
