From one TJ to another, yeah, it's basically that simple. If, say, you wanted to swap a ZJ's V8 powertrain in, though, it'd be a bit more difficult. You'd need to create engine and transmission mounts for it, and possibly use different-length driveshafts.
But yeah, if you wanted to put the whole drivetrain of another TJ into yours, it'd be as simple as finding a donor with all the parts intact, and changing them over. Of course, the only real reason to do it that way is if the donor is cheap and has frame and body damage, or is otherwise unusable, but its mechanical bits are all in better condition than yours.
1997 Grand Cherokee Orvis Edition
1998 Grand Cherokee 5.9 Limited
FUEL ECONOMY IS FOR LOSERS