xmlNodePtr child; xmlNodePtr lastMatch;
gboolean is_found = TRUE; xmlNodePtr match =  NULL; xmlNodePtr lastMatch = root;
find_xml_node_nested(xmlNodePtr root, const char **search_path, int len){	int	j;	xmlNodePtr child;	xmlNodePtr lastMatch;		if (root == NULL) {		return NULL;	}	if(search_path == NULL) {		crm_trace("Will never find NULL");		return NULL;	}			dump_array(LOG_TRACE,		   "Looking for.",		   search_path, len);	child = root->children, lastMatch = NULL;	for (j=0; j < len; ++j) {		gboolean is_found = FALSE;		if (search_path[j] == NULL) {			len = j; /* a NULL also means stop searching */			break;		}				while(child != NULL) {			const char * child_name = (const char*)child->name;			crm_trace("comparing (%s) with (%s).",				   search_path[j],				   child->name);			if (strcmp(child_name, search_path[j]) == 0) {				lastMatch = child;				child = lastMatch->children;				crm_trace("found node (%s) @line (%ld).",					   search_path[j],					   xmlGetLineNo(child));				is_found = TRUE;				break;			}			child = child->next;		}		if (is_found == FALSE) {			crm_trace("No more siblings left... %s cannot be found.",				search_path[j]);			break;		}	}	if (j == len	    && lastMatch != NULL	    && strcmp(lastMatch->name, search_path[j-1]) == 0) {		crm_trace("returning node (%s).",			   xmlGetNodePath(lastMatch));		return lastMatch;	}	dump_array(LOG_WARNING,		   "Could not find the full path to the node you specified.",		   search_path, len);	crm_warn("Closest point was node (%s) starting from %s.",	       xmlGetNodePath(lastMatch), root?root->name:NULL);	return NULL;    }