'Return div of footnotes as et Element.'

def makeFootnotesDiv(self, root):

    if (not list(self.footnotes.keys())):
        return None
    div = etree.Element(u'div')
    div.set(u'class', u'footnote')
    etree.SubElement(div, u'hr')
    ol = etree.SubElement(div, u'ol')
    for id in self.footnotes.keys():
        li = etree.SubElement(ol, u'li')
        li.set(u'id', self.makeFootnoteId(id))
        self.parser.parseChunk(li, self.footnotes[id])
        backlink = etree.Element(u'a')
        backlink.set(u'href', (u'#' + self.makeFootnoteRefId(id)))
        if (self.md.output_format not in [u'html5', u'xhtml5']):
            backlink.set(u'rev', u'footnote')
        backlink.set(u'class', u'footnote-backref')
        backlink.set(u'title', (u'Jump    back    to    footnote    %d    in    the    text' % (self.footnotes.index(id) + 1)))
        backlink.text = FN_BACKLINK_TEXT
        if li.getchildren():
            node = li[(-1)]
            if (node.tag == u'p'):
                node.text = (node.text + NBSP_PLACEHOLDER)
                node.append(backlink)
            else:
                p = etree.SubElement(li, u'p')
                p.append(backlink)
    return div
