pdebug("Adding node id... %s (%p)", id, new_node);
pdebug_action(print_node("Added", new_node, FALSE));
unpack_nodes(xmlNodePtr xml_nodes, GSListPtr *nodes){	pdebug("Begining unpack... %s", __FUNCTION__);	while(xml_nodes != NULL) {		pdebug("Processing node...");		xmlNodePtr xml_obj = xml_nodes;		xmlNodePtr attrs = xml_obj->children;		const char *id = xmlGetProp(xml_obj, "id");		const char *type = xmlGetProp(xml_obj, "type");		if(attrs != NULL) {			attrs = attrs->children;		}				xml_nodes = xml_nodes->next;			if(id == NULL) {			cl_log(LOG_ERR, "Must specify id tag in <node>");			continue;		}		if(type == NULL) {			cl_log(LOG_ERR, "Must specify type tag in <node>");			continue;		}		node_t *new_node = cl_malloc(sizeof(node_t));		new_node->weight = 1.0;		new_node->fixed = FALSE;		new_node->details = (struct node_shared_s*)			cl_malloc(sizeof(struct node_shared_s*));		new_node->details->online = FALSE;		new_node->details->unclean = FALSE;		new_node->details->shutdown = FALSE;		new_node->details->running_rsc = NULL;		new_node->details->id = cl_strdup(id);		new_node->details->attrs =			g_hash_table_new(g_str_hash, g_str_equal);		new_node->details->type = node_ping;		if(safe_str_eq(type, "node")) {			new_node->details->type = node_member;		}				while(attrs != NULL){			const char *name = xmlGetProp(attrs, "name");			const char *value = xmlGetProp(attrs, "value");			if(name != NULL && value != NULL) {				g_hash_table_insert(new_node->details->attrs,						    cl_strdup(name),						    cl_strdup(value));			}			attrs = attrs->next;		}				pdebug("Adding node id... %s (%p)", id, new_node);		*nodes = g_slist_append(*nodes, new_node);    	}  	*nodes = g_slist_sort(*nodes, sort_node_weight);	return TRUE;}