X300 engine in xj40

I have a 94 xj6 And was just wondering if the supercharged 4.0 from the x300 would fit in the xj40, it seems to be the same design but idk if the electrical would work.

You would have to change all the electrics that control the engine and trans.