it started off a few weeks ago with an intermittent cranking but not starting problem so i replaced the crank angle sensor, when that didnt fix it i replaced the plugs, leads, dizzy cap, rotor and coil, by this time the symptoms had changed to starting fine but then once warmed up would start to surge/missfire then eventually be running so badly that it would stall, once the engine stopped at this point it wouldnt start again untill the next day however some days it wouldnt start at all.
So i took it to the auto electrician where after having it for four days they eventually diagnosed and replaced a faulty camshaft position sensor. unfortunately this didnt fix the problem completely, instead now it starts fine everytime but starts surging straight away at idle and under acceleration, also if i take it for a drive up the street i can hear the engine pinging when accelerating.
Here is a video:
since then i have checked grounds, dizzy and tried swapping TPS and MAP sensors off a mates working XJ and still no change. Also worth noting i checked spark with a spark tester and everytime it stumbles the spark disappears so it has me convinced it is an electrical problem and not fuel.