Add a general document interface for use in operations.

This allows parts of the operation infrastructure to be reused for other types of xml documents.
The UndoManager and TrivialUndoManager classes are adapted to the generalized interface.