In presence of HCl, carbonyl group reacts with ethylne glycol to form cyclic acetal which is product X.
The ester group (−COOC2H5) is reduced to alcohol (−CH2OH) by using lithium aluminum hydride to form compound Y. This on hydrolysis in acidic medium breaks the cyclic acetal and regenerates the carbonyl group to give compound Z.