Welcome to the 2001 XJ.
It's a common fault that many of us suffer with.
For some reason the 2001 has a heat soak problem, maybe caused by the two mini-cats located just below the manifolds.
I tried all the suggested fixes, including the Factory's, without success.
I get it almost anytime when climbing up a long steep trail or on a hot day. Shut the engine off for a few minutes and then restart. The engine runs rough and stumbles for 20-30 seconds and the CEL goes on. The codes shows misfire on cylinder 3, 4 or multiple cylinder misfire.
My solution is to run the aux cooling fan for a few minutes after shutting the engine off. I made it easy by adding a relay, a push-button switch and a adjustable 12-volt timer.[FONT="] Running the fan for three minutes cures the problem. [/FONT]