Update transitive-closure-with-paths.xqy

removed the for loop in the bfs function for speed.