If we take 1mL of HCl solution, there will be 0.1mL of water and 0.9mL of pure HCl.
1mL of solution has a mass of 1.02g. The density of water is 1g/mL, so that's 0.1g/0.1mL. Therefore the mass of water in 1mL of the solution is 0.1g compared with 1.02-0.1=0.92g of HCl.
So the percentage by mass is 0.1/1.02=0.098 or 9.8% water. By volume it's 10%.