The example I gave will loop through all the possible paths in the list, and update every one that it finds.

Is that not sufficient to your needs?