Some 2010-13 XK models with 5.0-liter supercharged engines may produce a pinging noise under moderate acceleration or load.
According to Jaguar, the detonation typically occurs in the 1,200 rpm to 1,500 rpm range, and is due to the PCM not being able to respond correctly to the input signal from the knock sensor(s).
Reprogramming the module with updated software should eliminate the condition. Check with a dealer for the specifics of the flash.