def copyTable(document, tableSource, tableDestination):
# document is of odf.opendocument
# tableSource is a string with the name of the source table
# tableDestination is a string with the name of the destination table
# get all tables in document
allTables = document.getElementsByType(table.Table)
templateTable = None
for xTable in allTables:
if hasattr(xTable, 'attributes'):
tableName = xTable.getAttribute('name')