Hello and welcome to Just answer.com, Super mechanic here. About your vehicle.
There has been a service bulletin for that particular concern. You might want to perform this first. Here is what it states.
Head Restraint Inoperative - Drive Cable Not Fully Engaged In Gearbox - Repair Method
On 2003-06 MY XK Range vehicles, within the above VIN range, equipped with motorized head restraints, the head restraint drive cable may not be fully engaged in the gearbox. This condition can restrict upward and downward movement.
In case of a verified customer complaint, shorten the cable outer sheathing to permit full engagement of the drive cable as outlined below.
Remove and discard the hog rings securing the front seat backrest cover retaining straps (Illustration 4).
Release the front seat backrest cover sufficiently to allow access to the head restraint motor and drive cable (Illustration 6).
Thanks for your help.
It is greatly appreciated