There is some XML, it changes in the course of its existence.
Need to know what changes have been made.
Nowhere in XML objects is this information written or similar information I can get if I keep logging by hand by subscribing to events?
In general, I had some idea:
What if we introduce an additional attribute, for example, ChangeType, which will be placed in the nodes above which there was some kind of manipulation?
Let's say the client deleted a node, but in fact it did not go away, but it was marked as special. value, changed some node and a corresponding mark appeared, added another mark to the node.
Then the XML is sent to the server, the changes are registered, the attribute is deleted, and the deleted nodes are deleted.
XElement, they have aChangedevent, you can use it too.XmlElementseems to have no events of its own. But in any case, you should, yes, subscribe to the changes.XDocumentdoes not store its change history (why does it need it?). - VladD