The molar mass of water (\( \text{H}_2\text{O} \)) is 18 g/mol. Since we have 1 mole of water:
\[ \text{Mass of solvent} = 1 \, \text{mol} \times 18 \, \text{g/mol} = 18 \, \text{g}. \]
The total mass of the solution is the sum of the mass of the solute and the mass of the solvent:
\[ \text{Total mass} = \text{Mass of solute} + \text{Mass of solvent} = 2 \, \text{g} + 18 \, \text{g} = 20 \, \text{g}. \]
The mass percent of \( X \) is given by:
\[ \% \text{mass of } X = \frac{\text{Mass of } X}{\text{Total mass}} \times 100 = \frac{2 \, \text{g}}{20 \, \text{g}} \times 100 = 10\%. \]
The mass percent of \( X \) in the solution is 10%.