The X will be Magnesium ribbon (Mg) that is burnt in the presence of oxygen to form the compound Y that is Magnesium Oxide (MgO).
If you add MgO in water then it will dissolve partially in order to form Mg(OH)2 that is used extensively as an antacid for the stomach acid neutralisation.
The chemical reactions are:
2Mg+O2⟶2MgO
MgO+H2O⟶Mg(OH)2
The equations are completely balanced out.