xmlNodePtr action = findNode(root_xml_node, type);
xmlNodePtr action = find_xmlnode(root_xml_node, type);
validate_crm_message(xmlNodePtr root_xml_node, const char *sys, const char *uid, const char *msg_type){    FNIN();    if(root_xml_node == NULL) FNRET(NULL);    const char *from = xmlGetProp(root_xml_node, XML_MSG_ATTR_SYSFROM);    const char *to = xmlGetProp(root_xml_node, XML_MSG_ATTR_SYSTO);    const char *type = xmlGetProp(root_xml_node, XML_MSG_ATTR_MSGTYPE);    const char *reference = xmlGetProp(root_xml_node, XML_MSG_ATTR_REFERENCE);    cl_log(LOG_DEBUG, "Recieved XML message with (version=%s)"       , xmlGetProp(root_xml_node, XML_ATTR_VERSION));    cl_log(LOG_DEBUG, "Recieved XML message with (from=%s)"          , from);    cl_log(LOG_DEBUG, "Recieved XML message with (to=%s)"            , to);    cl_log(LOG_DEBUG, "Recieved XML message with (type=%s)"          , type);    cl_log(LOG_DEBUG, "Recieved XML message with (ref=%s)"           , reference);    const char *true_sys = sys;    if(uid != NULL) true_sys = generate_hash_key(sys, uid);    if(to == NULL)    {	cl_log(LOG_INFO, "No sub-system defined.");	FNRET(NULL);    }    else if(true_sys != NULL && strcmp(to, true_sys) != 0)    {	cl_log(LOG_DEBUG, "The message is not for this sub-system (%s != %s).", to, true_sys);	FNRET(NULL);    }        if(type == NULL)    {	cl_log(LOG_INFO, "No message type defined.");	FNRET(NULL);    }    else if(msg_type != NULL && strcmp(msg_type, type) != 0)    {	cl_log(LOG_INFO, "Expecting a (%s) message but receieved a (%s).", msg_type, type);	FNRET(NULL);    }    if(reference == NULL)    {	cl_log(LOG_INFO, "No message reference defined.");	FNRET(NULL);    }        xmlNodePtr action = findNode(root_xml_node, type);    if(action == NULL)    {	cl_log(LOG_INFO, "Malformed XML.  Message type (%s) not found.", type);	FNRET(NULL);    }    /* when the msg is a request, the message will contain <dest_sys>_request node.     *   Otherwise it will contain a <src_sys>_response node.     */    const char *action_sys = from;    if(strcmp("request", type) == 0)    {	action_sys = to;    }    int action_len = strlen(action_sys) + strlen(type) + 2;    char *action_target = (char*)ha_malloc(sizeof(char)*(action_len));    sprintf(action_target, "%s_%s", action_sys, type);    action_target[action_len-1] = '\0';        action = findNode(action, action_target);    if(action == NULL)    {	cl_log(LOG_ERR, "Malformed XML.  Message action (%s) not found... discarding message.", action_target);	FNRET(NULL);    }        cl_log(LOG_DEBUG, "XML is valid and node with message type (%s) found.", type);    cl_log(LOG_DEBUG, "Returning node (%s)", xmlGetNodePath(action));    FNRET(action);}