Technically it should work - Aside the td5 having electronic control of shifting as opposed to hydraulic governor controlled, I believe the housing and core of the zf 4hp 22 transmission is the same between them.
Actually love projects like what you're planning - a few years back, swapped a dead...