Try overhauling the rear derailer first. Unless something is obviously broken (bent cage, something snapped, worn pivots) you should be able to fix everything. Try this: take the derailer off the bike. If it's the series of XTR I'm thinking of, it should have a massive return spring inside the parallelogram- try hitting that with some solvent and working the thing back and forth. Blast it out with compressed air and try again. It should move smoothly and there should be no play in the cage, pivots, or parallelogram. You can check Park Tool for more info on how to re-build a derailer- you can probably salvage this one by cleaning the spring or overhauling the pulleys.