If its the newer 3.0 (M54) 2001... This replaced your M52, so have a look at this... BMW World - M54 Engine
Even if its the older unit, they should both bolt to your existing gearbox! But you should check the crankshaft output to the clutch/torque converter to see any modifications.
In both cases I think you would need the ECU's though...