'Write the book as an LRS to file f.'

def render(self, f, outputEncodingName='UTF-8'):

    self.appendReferencedObjects(self)
    root = self.toElement(self.sourceencoding)
    _formatXml(root)
    writer = ElementWriter(root, header=True, sourceEncoding=self.sourceencoding, spaceBeforeClose=False, outputEncodingName=outputEncodingName)
    writer.write(f)
