fix to_xml and add update domain