[TASK] Add XML validation before saving