This seems needlessly complex - I just made a UDF that recursively calls itself with more than 1 parameter in my temp database and it works fine?
Example (and it's a silly one but it does work - it's 1am here!)
create function recurse(
declare @result varchar(8000)
if @p1 = 0
set @result = @p2
set @result = dbo.recurse(@p1 - 1, @p2 + '.' + cast(@p1 as char(1)))
print dbo.recurse(5, 'X')
I can see the benefit of the idea for some reporting purposes where you cannot have the tool work out how the hierarchy relates in client-side code, but if the entire hierarchy is being sent back to the client, you could also just send back the table and let the client sort out the display as well... Depends on the circumstances I suppose.
If someone is to implement in their DB/software, try rewriting without the messy string splitting for parameter passing - I don't see why it shouldn't work...