What year is your XJ40?
(Adding the vin number to your forum signature is always a good idea.)
Jaguar made a special towbar relay box for use with towbar electrics.
However I have seen it done by just connecting into the rear lights, but I am not sure if this will work on the later cars, it may well mess up the bulb fail system as you will be running three bulbs on a circuit intended for just one.
See this post for photos of the Jaguar towbar that requires no holes to be drilled into the car and has an electric module that plugs in to existing wireing in the car. (This is not a late 93/94 model.) :viewtopic.php?p=168295#p168295