Gearbox is the same on the diesel and 4.0 litre V8 but you would need to use the bellhousing and torque converter from the V8 to mate the two. 4.6 has a stronger gearbox but a number of people have swapped 4.0 litre for 4.6 engines, left the original gearbox and had no problems. If you were to drive it hard all the time then you may find the weakness but under normal use it shouldn't be a problem. You may have a problem with the BeCM to ECM data link and the engine wiring loom is going to be different so you would need to use the one from the V8 too. Fuseboxes are different as well so you may need to do some rewiring to get things working. As to cost, it will cost what it costs. If you have access to a complete car that is going to donate the engine and other bits and do all the work yourself, it shouldn't cost that much money, just an awful lot of time.