A patch file is an XML document, normally saved with the extension `.patch`. It consists of a header and a body. ## Header The header holds: - the identification of the original object: its kind, its identifying values and, when it was taken from the [[Invantive Studio/Repository/Concepts/History|history]], its moment; - the identification of the resulting object, in the same way; - the comment entered when the patch was created. ## Body The body holds one entry per object that changed: - the identification of the object by its kind and its [[Invantive Studio/Repository/Concepts/Natural Key|natural key]]; - the action: `Insert`, `Update` or `Delete`; - for every field that changed, the change itself. A changed text is stored as the characters inserted and deleted at given positions, not as the whole new value, which is what lets a patch apply to a text that differs slightly. A value of another type is stored as the old value removed and the new value inserted. Fields of the natural key are not stored as changes, because they identify the object.