How to pass hierarchical path as string

In reply to dave_59:

So there is no way to store hiercachical path in a variable as object or something and possibly pass them to a function / method?

thanks much