Save original xml_data only when needed