Rod.
It has been a while since I have had a XR400 apart, but, if my memory serves me correctly:eek: you don't have to split the center cases to remove the shift shaft.
Remove the right side case and it will expose the shift mechanism. You will probably have to remove the clutch. Disconnect the shift ratchet mechanism from the shift drum and remove the shift lever from the left side and the shift shaft should slide out the right side.
If the shift shaft is bent on the lever side, be sure to take a piece of pipe or tubing that fits tightly over the shaft end and straighten it before trying to remove it from the cases. Otherwise it could damage the bore in the cases where the shift shaft rides.
The main recommendation that I could make would be to purchase a service manual and read it thru before taking the bike apart.
Just my $.02.