From: Plamen Ratchev on
Since this is a table valued function you can use it with CROSS APPLY:

....
SELECT <columns>
FROM MyCTE AS C
CROSS APPLY dbo.tfs_GetGroupAncesters_Function(var1) AS F;

--
Plamen Ratchev
http://www.SQLStudio.com