I'm not sure, what you want to achieve. ... The toc macro is a "relatively" straight forward recursive macro, that creates a structure using ordered lists. So changing this behaviour, to create a simple list, should be possible.
If you want to print out a dynamically generated filter, that's used to create the toc, this should be possible too. .. But the result will be super ugly and barely readable for humans. We have to deal with "infinite recursion protection", which makes the filter ugly.
Can you clarify the usecase a bit?
-mario