Congratulations on your purchase; you do not need to remove the unit for purposes of obtaining the code.
In the case of our XJS, a 'phone call to a local Jaguar dealer, giving the reg number and VIN number resulted in a call back within an hour or so with the code. The process does seem to vary from dealer to dealer; some will require ID, some will attempt to charge (walk away!), but some will do as we did. We made our 'phone call to Stratstone jaguar at Lye (Stourbridge)....give it a go.
Enjoy, and don't forget to purchase a trilby in place of the baseball cap!
Happy growling