What you can do is create a NotificationEvent from setDocument and make ur MBean Capture that event. Your Mbean Event capture code can then update the documentAsText Field which will be the new value!!
This sounds sort of very imperformant. If I have to do it that way. there is no need for having a Document type attribute. Then I should simply stor the text.
I managed my XMBean to store Document-objects now. To load an xml-file into this attibute I added a managed operation to the XMBean which reads a file and stores the resulting Document in the corresponding attribute of my XMBean. If I want to make the changes persistant, I have to store the object through the MBean server instead of using the local setDocument or directly storing it at this.document.
Is there a way of telling the MBean server do persist the XMBean manually?