Move xml_add utilities to xml_add.c source