'Convert a tree between different subtypes of Tree.  ``cls`` determines
which class will be used to encode the new tree.
:type tree: Tree
:param tree: The tree that should be converted.
:return: The new Tree.'

@classmethod
def convert(cls, tree):

    if isinstance(tree, Tree):
        children = [cls.convert(child) for child in tree]
        return cls(tree._label, children)
    else:
        return tree
