Expanding tree path

Hi everybody,
i’m figuring out how to implement a ‘expand tree path’ method: basically, i want to expand the tree starting from the root trought the complete path that leads to a tree node that i provided as an input. I’ve tried to use the recursive node expand method, but do not seems to work correctly. Could you please give me some advice how to achieve all of this?
Thank you for your answers!