'Return the document serialized as a single UTF-8 encoded bytestring.'

def __call__(self):

    buf = self.buf = StringIO()
    buf.write('<html>')
    self.serialize_head()
    self.serialize_body()
    buf.write('</html>')
    self.end_offset = buf.tell()
    self.fixup_links()
    if ((self.start_offset is None) and (not self.is_periodical)):
        self.start_offset = self.body_start_offset
    return buf.getvalue()
