While you're on eBay...
...pick up an Owner's Manual for your XJ. They end up going for about $6 bucks.
Anyway..if you have the IR keyless, the manual says:
1. Sit inside the vehicle and close all the doors-
2 .Place ignition in the OFF position-
3. Open the driver's door and leave open during programming procedure-
4. Move the mechanical door lock lever to the LOCK position-
5. Turn ignition to the RUN position-
6. Aim the transmitter at the Keyless Entry reciever and press the Lock button-
7. Hold the button until the light on the transmitter blinks twice. The door locks will cycle-
8. Turn ignition OFF within 20 seconds.
9. Check reciever memory by cycling the door locks using the transmitter. Up to four transmitters may be programmed to a vehicle.
And that's it! If by chance you have the RF system it's even easier. Go into the "Set-up" or "Menu" portion on the overhead info display and scroll to the "Keyless Entry" portion, and just follow the prompts.
Good Luck!