DR-131 XDoc: add method to change state of an instance to the state of another instance

Added a simple method to copy the state of a given XDoc instance.