generic zipper algorithm for outputting original source tree + mods