We compute exactly the local magnetization <σxj> for the semi-infinite XY-chain at zero temperature as a function of the distance from the boundary j and the anisotropy parameter γ. It is shown that in the limit j → ∞, γ → 0 the local magnetization has the scaling form <σxj> = γ14f(2γj). We derive an exact expression for the scaling function f(x) and analyze both the small- and large-x behaviour.