I had to do this repair on my XJ when I got it, as, while the previous owner had it, someone broke in and stole the stereo. They didn't damage the lock cylinder, but it was floating loose in the door, though still hooked to its lever, the door sheet metal around the hole was bunged up a bit, and the clip that holds the cylinder in place inside the door was broken. I priced a replacement cylinder at the dealer, about $17, does not come with shims or keys or clip. Locksmiths have shims to fit. Instead, I got the clip, opened up the door panel, pulled the cylinder, graphited it good, got it working smoothly, straightened out the sheel metal, and put the whole thing back together, not pretty, but it works like new.
Are you sure the cylinder itself is damaged? Is the casting broken? If so, check for a dealer price. If you want to replace it all, make sure you get everything. If you have to, you can pull the panel on the passenger side to see what you need. You'll have to take a new cylinder to the locksmith to have it keyed to your key. You might find one at a wrecking yard too, but I'd just get a new one, it ain't that much money. The locksmith will probably charge about $10 or so.
This is one of those little things where it's just better to do it right. Makes life easier.