def METHOD_NAME(self):
    # Save what we have written until now so that the buffer
    # itself is empty -- this makes it ready for insertion
    if self.stream.tell():
        self.prepended_children.append(StringIOTree(self.stream))
        self.prepended_children[-1].markers = self.markers
        self.markers = []
        self.stream = StringIO()
        self.write = self.stream.write