Further progress with the search
I'm now about half way through implementing the search/replace. I found some things that needed improving in the code already written. For instance, I was failing to check for well-formedness when writing nodes back to the document which had changed due to string replacements. Then I realized I wasn't tracking successful replacement instances (as opposed to find hits); where replacement would cause a broken doc, the replacements are not done, so find hits are not equal to replacements. That's all fixed now.
Finally, I've mapped out the function for doing a Find Next, which is complicated because it can be upwards or downwards, and has to iterate through the many different document components appropriately. I've not yet added the MatchCase and WholeWordOnly booleans to the function signature -- mustn't forget that. I should be able to call SearchContainer to do the actual search, so that there's the potential for rudimentary regexp functionality in the future.
Another few hours should get me to the working-GUI point, where I can really start hammering it for bugs. It's way more complicated than you would think, especially if you're going to protect the user from destroying their document structure (which I am).