Hi spannernut,
Welcome to club-xm. If you do get yourself an XM you'll find a bunch of really helpful people here who will help keep your car on the road and reduce those dreaded garage bills.
Unfortunately, I know of no way to read or reset the code in the ecu. Maybe someone else who reads this may be able to shed some light on it. Can you describe what happens to the red and green lights on the keypad for the one without the code? One of my 2.5TD's has the code bypassed and starts without it.
Sorry to rain on your maserati parade but you've got your Citroen models mixed up. The model which had the Maserati engine was called the SM not the XM. I used to have one. It was the carburretor model with manual box. Unfortunately, I no longer have it. I'm not sure if that scuppers the XM transplant project but there are several significant hurdles in any case. The porche engine (I believe) is axial whereas all XM engines are transverse. I'm not sure how you would change that. The other issue is one of space. Is the proche engine not a flat four?
Why not just buy the XM and leave it as an XM? Its a much better car than the porche
Sorry I couldn't be of more help.
cheers
noz