Very, very, very common problem with late model (I'm assuming you have a 97+) XJ's. The window is held on to the worm drive with a thin piece of plastic film that is prone to breakage. This means getting it back on track will not solve your problem. To answer your question though, you need to remove the door panel, disconnect the power lock / window controls, disconnect the lock / latch mechanism, and finally remove the window regulator itself. It's really pretty easy after you have done it a few times...
Here's your options:
1. Replace the regulator (they don't sell the window bracket individually). They cost about $250 new or around $80-100 used on ebay.
2. Disassemble the window bracket and modify it so you can re-attach it to the worm drive with safety wire. This is what I did but it only lasts about a year each time you fix it and it eventually ruins your rails. This prevented me from using option number 3...
3. There is a guy on ebay that sells XJ window repair kits (I told you this is a common problem). They go for $50 and essentially do the same thing as my option number 2 in a much cleaner fashion. Look it up on ebay, he has really thorough directions (with pictures) on how to take apart and reassemble the door and window mechanism.
After fixing my driver's window 4 times and the passenger's window 2 times, I decided it was finally time to replace the regulators. When they break again, I'll give the repair kit a try.