All 6 pot boxes from the petrol E36 will fit with no problem, and to be honest, I would think that the E34 gearboxes will fit aswell - just the remote linkage that will be different I suspect
I'm looking at using a 330d 6 speed box in my 530d - ratios are the same upto 5th (with 5th being 1:1 in both boxes) and 6th being 0.87:1 - should do better on the motorway cruise