xmlDocPtr foo = NULL;
write_xml_file(xmlNodePtr xml_node, const char *filename) {	int res = 0;	xmlDocPtr foo = NULL;	char now_str[26];	time_t now;	crm_debug("Writing XML out to %s", filename);		if (xml_node == NULL) {		return -1;			} else if (xml_node->doc == NULL) {		crm_insane("Creating doc pointer for %s", xml_node->name);		foo = xmlNewDoc("1.0");		xmlDocSetRootElement(foo, xml_node);		xmlSetTreeDoc(xml_node, foo);	}	now = time(NULL);	ctime_r(&now, now_str);	set_xml_property_copy(xml_node, "last_written",now_str);	/* save it.	 * set arg 3 to 0 to disable line breaks,1 to enable	 * res == num bytes saved	 */	res = xmlSaveFormatFile(filename, xml_node->doc, 1);		/* for some reason, reading back after saving with	 * line-breaks doesnt go real well 	 */	crm_debug("Saved %d bytes to the Cib as XML", res);	return res;}