The energy change when diamond converts to graphite is \( X \). The total enthalpy change for the complete oxidation of diamond to carbon dioxide is the sum of the enthalpy changes of the oxidation steps of both diamond and graphite. Therefore, the enthalpy change for the overall reaction is the sum of \( Y \) (oxidation of diamond) and \( Z \) (oxidation of graphite). Hence, \( X = Y + Z \).
Thus, the correct answer is \( \boxed{(4)} X = Y + Z \).