Attempting to write parsed xml to lxml element

Not able to populate multiple KWIC tables.

Failing at line 122: allContextsPerDoc.extend(finalOutput)
TypeError: 'ElementTree' object is not iterable