Hi guy's

Please can some one tell me if i can put a z22se engine in to a 2.2 sxi there are the same year & both are auto, why i ask is i am having probs with my auto & can buy a sxi with engine probs but the gearbox is fine so am thinking i could fix the sxi or if i can not put the engine i will just have to keep my ls
& put the box in. Let me know what you guy's think thank's. Paddy