Okay looks like you have the typical Jag issue of a bad throttle body ?? But need the codes to be sure .
It sound like it could be this from what i have just read from your question .
APP accelerator pedal sensor malfunction .or the Throttle body malfunction .
See if you can get me the codes to confirm this for you .
In the mean time disconnect the connection on the accelerator pedal and check and clean the connections with contact cleaner .
also do the same to the throttle body connections and check the wiring harness for damaged .
Still need additional information then please get back to me with the reply button, and not the poor or bad service, this way i can get back to you or suggest another expert if needed.
Your deposit does not pay me until the answer is rated in a positive way,
A bad rating does not constitute a refund.
If you are not happy or you have sorted out your problem before the answer then please let me know with the reply button .
Kind regards Greg.