X has atomic number 17, so it is Cl. Y has a valency 3.This means there should be minimum 2 electrons in the s shell. This means that Y has total 5 electrons. Thus the element is Boron. The compound formed between X and Y after exchange of valency will be BCl3. Regards