Add a method to get the path of a node.