A couple years ago my wife bought a 2003 jetta TDI with Ottomatic transmission. Paid too much for it, particularly when the slushbox did not pass oil analysis, and promptly began shifting poorly. Luckily, a friend who owns a VW shop brought in a scrap tdi Jetta, with 5 speed, and so, working with another friend who has a small shop, we did the transplant job. It took about three days, and lots of new parts (clutch, flywheel, etc), but it started up and ran with minimal problems. (The 'check engine' light is still on...ECM needs to be re-programmed. Six months later, the manual trans went bang. Panic. Luckily, the same helpful shop owner had just taken in a tdi gasser with a manual 5 speed, so we worked the swap of gasser trans into tdi. It worked...ok. The car is very short-legged, because the gas Jetta engine turns a lot higher than the tdi. So now we have a car that's had a lot of money put into it, with a transmission from who knows where? The only way that suggests itself to make the car act like a tdi is to install a tall fifth gear, either a .658 or a .622. It would make for a busy life in the differential box.
There are reports of retro-fit six speeds, but that would need a whole bunch more new parts. What to do? LESSON ONE! Inspect any gearbox out of a "hanger queen" very carefully. Do the oil analysis. Lean toward a lower-mileage rusted out northern car over a high miler. Realize that you really need a whole hanger queen, because you need fly wheel, clutch pedal & hydraulics, half-shafts, motor mounts, etc, etc, world without end, amen. Unless you're really lucky, this isn't a cheap project.