Add an extension method in the TreeNode class, that clones a TreeNode and returns a casted TreeNode.