Is this xjs a 6 or a v12. Check temp sender unit is operating correctly also you could have a problem with ECU unit. Trigger mechanism in your distributor could also cause fuel injection system to fail if faulty. Distributor could also have problem with mechanical and automatic advance units . Because this xjs is very old it could also have ignition wiring issues which unfortunately is a problem with older jags. Did you also change spark plugs and leads , also did you check distributor cap for hair line cracks which can cause engine to run erratically