An element X of atomic number 12 combines with an element Y of atomic number 17 to form a compound XY2. State the nature of the chemical bond in XY2 and show how the electron configuration of X and Y change in the formation of this compound.