Nothing is impossible but what you are thinking is probably too much work. The engine and gear box difference is obvious. You know from the output shaft of the gear box to the rear wheel the 540 also has a heavior setup because of the additional torque and HP. This is likely only one part of it. ABS, cooling system, brake booster, steering, almost everything in the engine compartment is different.
And electronics..
Still want to do it?
'01 540it, 6/01
'03 325i 5 speed, 9/02
'10 535ix. 9/09
'10 mini 6 speed
'15 mini countryman 6 speed