I've never seen that problem on the 91-97 model XJ's. Does the 97 still have the ignition coil? Can't remember if they did away with it in 97 or 98. Anyway, in the Renix XJ's it was pretty common for the CPS to heat up and stop working, never heard of that being an issue in later OBD 1 and OBD 2 type models. I guess anything is possible.
I've seen the CPS short and cause grief, but it didn't seem to be temperature related.
The next time it craps out, run around to the distributor side of the block and touch your finger on the side of the coil. Be carefull it may be too hot to touch. If it is too hot to touch, it may be overheating and failing, I've seen that before.
The next time it craps out, have an ohm meter handy and check the CPS for a short. Not sure about the CPS ohm test for a 97, I have a 96, it may be the same test it may not. I'll try to look it up, if I have it in my PDF files someplace I'll post the test.