'Reconstruct the element tree of this job'

def get_tree(self):

    if (self.tree is not None):
        return self.tree
    else:
        xml = current.xml
        ATTRIBUTE = xml.ATTRIBUTE
        UID = xml.UID
        root = etree.Element(xml.TAG.root)
        for item in self.items.values():
            element = item.element
            if ((element is not None) and (not item.parent)):
                if ((item.tablename == self.table._tablename) or element.get(UID, None) or element.get(ATTRIBUTE.tuid, None)):
                    root.append(deepcopy(element))
        return etree.ElementTree(root)
