log_data_element("diff:input", NULL, LOG_DEBUG, 0, old, TRUE);
log_data_element("diff:input", NULL, LOG_DEBUG_2, 0, old, TRUE);
apply_xml_diff(crm_data_t *old, crm_data_t *diff, crm_data_t **new){	gboolean result = TRUE;	crm_data_t *added = find_xml_node(diff, "diff-added", FALSE);	crm_data_t *removed = find_xml_node(diff, "diff-removed", FALSE);	crm_data_t *intermediate = NULL;	crm_data_t *diff_of_diff = NULL;	int root_nodes_seen = 0;	CRM_DEV_ASSERT(new != NULL);	if(crm_assert_failed) { return FALSE; }	crm_debug_2("Substraction Phase");	xml_child_iter(removed, child_diff, NULL,		       CRM_DEV_ASSERT(root_nodes_seen == 0);		       if(root_nodes_seen == 0) {			       *new = subtract_xml_object(old, child_diff, FALSE);		       }		       root_nodes_seen++;		);	if(root_nodes_seen == 0) {		*new = copy_xml(old);			} else if(root_nodes_seen > 1) {		crm_err("(-) Diffs cannot contain more than one change set..."			" saw %d", root_nodes_seen);		result = FALSE;	}	root_nodes_seen = 0;	crm_debug_2("Addition Phase");	if(result) {		xml_child_iter(added, child_diff, NULL,			       CRM_DEV_ASSERT(root_nodes_seen == 0);			       if(root_nodes_seen == 0) {				       add_xml_object(NULL, *new, child_diff);			       }			       root_nodes_seen++;			);	}	if(root_nodes_seen > 1) {		crm_err("(+) Diffs cannot contain more than one change set..."			" saw %d", root_nodes_seen);		result = FALSE;#if CRM_DEV_BUILD	} else if(result) {		crm_debug_2("Verification Phase");		intermediate = diff_xml_object(old, *new, FALSE);		diff_of_diff = diff_xml_object(intermediate, diff, TRUE);		if(diff_of_diff != NULL) {			crm_err("Diff application failed!");/* 			log_xml_diff(LOG_DEBUG, diff_of_diff, "diff:diff_of_diff"); */			log_xml_diff(LOG_DEBUG, intermediate, "diff:actual_diff");			result = FALSE;		}		crm_free(diff_of_diff);		crm_free(intermediate);#endif		diff_of_diff = NULL;		intermediate = NULL;	}	if(result == FALSE) {		log_xml_diff(LOG_DEBUG, diff, "diff:input_diff");		log_data_element("diff:input", NULL, LOG_DEBUG, 0, old, TRUE);/* 		CRM_DEV_ASSERT(diff_of_diff != NULL); */		result = FALSE;	}	return result;}