I have a chance to buy a complete 2 wheel drive 2001 xterra with the KA24DE motor, and a 5 speed manual trans. My old 86 720 4x4 needs a clutch and trans work anyway, so is this a doable swap? I will have the whole xterra to rob the fuel system and electronics off of, so I am not concerned there. But will it physically fit? From what I have read, I am guessing custom oil pan, mounts, and most likely a drive shaft. Any other hurdles? Or at worst case would the trans swap relatively easily ?

The guys on ratsun might have more knowledge. I think the swap will not require a different oil pan. I think it should physically bolt right in. the wiring will be the difficult part. There is a really helpful how to article out in the internets somewhere that would be really helpful. Its called "how to wire a ka24 into anything".

The ka swap is relatively easy and is very well documented on ratsun, alot of the guys on there build and sell just about everything that is needed to do the swap. As for wiring your best bet is to find a 240sx wiring harness and ecm since the engine harnes isnt integrated with the rest of the harness like the xterras, it will make the swap so much simpler.

if you're doing away with 4x4 you've got to drop the front diff and cv shafts etc. the 2wd transmission wont bolt up to a 4x4 transfer case, cross members may be different, but the 2wd to 4x4 swap has been done.
Check over on clubfrontier.org with a guy named roastbeef, he modified a 2wd frontier trans to fit a tx10 transfer case so you should be able to do the same if you're prepared for all the work