Hi Phil, You might want to take a look at the refactoring engine code. In the image it is not so well documented. The way it is used in Nautilus might help you.
There used to be a RewriteTool that was designed for large scale refactorings (using regular expressions), but I don't know if that was resurrected already. Stephan