I'd almost ask what year XJ? I went through on a few XJs, that they would turn over but not start. One was a '98 and recently an '00. The '98 was the coil. Its been a few years, so I do not know what I did or replaced to get to that point.
On the '00, I bought it and it would not turn over. New battery and I made up some HD battery cables. Then it turned over. I did get a code on the TPS. I replaced it with and after market. No luck. Then a MOPAR, no luck. I replaced CPS, CPK etc. Again , no luck. I sprayed starting fluid, no luck. I tried to diagnose this with an Ohm and Volt meter. Sometimes there was voltage, other times not. I bought a set of Noid lights. I would crank and no light. Then when I turned the key off, there was a flash of light. A friend at work though it might be the ignition relay. It didn't start. Then I put in some starting fluid, it back fired. Loud. Then I cranked it a bit, and it started. I tired it again, then with starting fluid, same thing. Next day it started fine. I did put in rebuilt injectors before. I don't know if they need to cycle a bit or not. The starter relay or ignition switch I am talking about goes on the steering column on the left side. There is also a transfer part from the cylinder to it. I bought mine from NAPA. It was a lot more expensive from another place. Also, check battery voltage.