'Converts the document to a string.
FIXME: Result from second call differs from first call'

def toString(self):

    body = self.content.getElementsByTagName('office:body')[0]
    text = body.childNodes[0]
    buffer = []
    paragraphs = [el for el in text.childNodes if (el.tagName in ['draw:page', 'text:p', 'text:h', 'text:section', 'text:list', 'table:table'])]
    for paragraph in paragraphs:
        if (paragraph.tagName == 'text:list'):
            text = self.listToString(paragraph)
        elif (paragraph.tagName == 'text:section'):
            text = self.textToString(paragraph)
        elif (paragraph.tagName == 'table:table'):
            text = self.tableToString(paragraph)
        else:
            text = self.paragraphToString(paragraph)
        if text:
            buffer.append(text)
    if self.footnotes:
        buffer.append('----')
        for (cite, body) in self.footnotes:
            buffer.append(('%s:    %s' % (cite, body)))
    buffer.append('')
    return self.compressCodeBlocks('\n'.join(buffer))
