Hi Carl,
The first place will always be the battery, make sure it is fully charged. That said, XF’s do seem to have problems with door locks and once you start getting problems with them the only fix is to replace. The interior light is directly linked to the door lock mechanism and is further indication of door lock problems.
A battery maintainer and a Jaguar related code reader should definitely be on your shopping list.