I wouldn't attempt the swap without 1) a lot of time on my hands, and 2) the donor ML500 parked right next to it for comparison and as a supply of parts. At the very least you will need the springs off the suspension of the ML500. Probably best to move the transmission with the engine. You'll need all the engine and transmission electronics. Expect the exhaust system is different as well.
M-B does a lot of hidden magic with the ECU and engine electronics. You'll need full access to a Star system to get everything reprogrammed.
As has already been said you are best off not trying to invent something by installing a different model of engine. Its difficult enough if you get a slightly different model of ML350 engine.
If costs are similar I think you will have fewer problems fixing your existing engine.