Needless to say, you should always use the correct grade oil in your gearbox. Total manufactures it for Citroën/Peugeot with a grade of 75W. This is sometimes referred to as 'motorcycle gearbox oil'. Substitutes, ATF for instance, or any gearbox oil with incorrect grade, will leak from the top of the box, through the plastic tube where the gearbox lever enters the housing. Even with the correct oil it will leak slightly (it seems that the gearbox was not actually designed to operate in the slanted position it is fitted in).
Don't use any additive in the oil if you can avoid it, although in very cold climates you might need such an additive. In that case, be very sure that it is meant to be a gearbox oil additive. Some engine oil additives claim to work in the gearbox as well but they do not. They do decrease friction but friction is essential to the correct operation of the synchro rings in the gearbox. With less friction, gearchange (particularly downshifting) will become troublesome.
For one reason or another, some parts might wear out. Watch out for the ball in the pantographic mechanism connecting the gearchange lever to the gearbox. Oil deposits and heat are known to take their toll on very high mileage cars, and it's possible to get the pantograph to actually slip out of alignment, and one of the ball joints on the levers to pop out making gearchange impossible. This is fortunately a very rare occurence and also easy to correct, provided you are willing to get dirty. The levers are accessible from below when the suspension is in the highest position.
Don't forget, you have to have an inspection pit or put the car on axle stands to work under it--never rely on the suspension itself to keep it up!
The gearbox could become stuck in reverse or fifth gear. Early XMs, both diesel and manual V6, can be affected. The main gearchange lever has a pin sliding into a groove in one of the three gear pair engagement levers, as you move the gearchange from the left to the right. Moving the gearchange lever forwards or backwards then moves the appropriate gear pair lever engaging either one of the gears in the pair, 1-2, 3-4 or 5-R. The gear pairs themselves have three sprung balls a pair that go into grooves, providing a lock mechanism so they stay either in one gear, the neutral position, or the other gear in the pair.
As the main lever in the gearbox and the three mentioned levers wear out, the main lever might slip out of the fifth/reverse pair lever inside the gearbox as you go from fifth or reverse to neutral, however, due to a collection of gaps and worn-out points in the mechanical chain, the gear was not completely disengaged, to the point where the spring and ball retaining mechanism locks the gear pair in place. As the main lever slips out and the gearchange lever in the cabin goes to neutral, the spring and ball mechanism in the gearbox, having been pulled almost to the point where the gear was disengaged, suddenly finds itself free of any opposing force, and slips back into its previous stable condition, into the gear it was being pulled out of. As the construction of the gearbox makes it impossible to engage two gears at once, your box will be stuck, not allowing you to engage any other gears.
The gearbox can be unblocked very easily: you have to remove the cover (the oil will pour out unless the front of the car is jacked up quite high) and push the fork inwards (if the box is stuck in 5th) or pull it outwards (if stuck in reverse) until you can hear a click. Quite often a very slight movement is enough to free it and to return the box to neutral and to restore the normal operation. But you shouldn't stop here: you should adjust the fork to compensate for the wear of the parts involved, in order to avoid getting it stuck once again. The fork is secured on its lever with a bolt; loosen but do not remove it, move the fork a fraction of a millimeter in the required direction -- don't overdo it, this small adjustment is enough. Going any further will lead to the gearbox starting to stick again, if you look into the box, you will see the cogwheels get almost to the right point but then return to neutral, almost fly over to the opposite gear, then get back to neutral. As you adjust the fork and keep trying to cause this lock, it is possible that you will get the gearbox to start locking rarely, without any preference to fifth or reverse. If you do, the worn-out lever will have to be replaced, and possibly the gears and synchro rings too. In most cases, however, by carefully adjusting the fork position and testing both for fifth and reverse getting stuck, one comes to a point where no matter how many times you try the problem does not occur any more.
Be very sure that you have tested the box for possible jam by doing the described manoeuver at least fifty times before you decide to call it a day, and be sure to check both fifth and reverse getting stuck not even once. Once it has been adjusted properly, be similarly sure that you have tightened the bolt properly, because if it loosens or falls out, you will end up with either a blocked or broken gearbox. If you got it to work, it should only be considered a remedy for the symptom, not the real cure: it would be advisable to have the gearbox off at the next opportunity and the worn-out part changed.
By the way, the original bolts securing the cover are of the Torx type. It is a good idea to routinely replace all Torx bolts with the usual hex ones, they are the same as access is concerned and much easier to find tools for, especially if you happen to have a problem far away from home.