I apologize if this is an odd question. In the derivation of equations of motion in the Polyakov action
$$S_P = -\frac{T}{2}\int d^2\sigma \sqrt{-h} h^{ab}\partial_a X^\mu\partial_bX^\nu \eta_{\mu \nu}\tag1$$
where fields $X^\mu(\tau,\sigma)$ are scalar fields under worldsheet diffeomorphisms, we obtain the following boundary term [1]
$$-T\int_{-\infty}^{\infty} d\tau\left[ \sqrt{-h}\partial^\sigma X^\mu \delta X^\mu\right]^{l}_{0}. \tag2$$
One of the boundary conditions for closed strings are imposed by Polchinski as the $l$-periodicity of $X^\mu$
$$X^\mu(\tau, 0) = X^\mu(\tau,l).\tag3$$
However, I don't know how this implies that $\delta X^\mu(\tau,0) =\delta X^\mu(\tau,l)$ from the definition of variation (deformation) of a field given in Joshphysics answer to this post. Following his notation, $$\delta X^\mu := \frac{\partial \hat{X}}{\partial \alpha}(0,\tau, \sigma)\tag4$$ where $$\hat{X}^\mu (\alpha, \tau, \sigma) : \hat{X}^\mu (0, \tau, \sigma):=X^\mu (\tau, \sigma) \tag5$$
Of course, periodicity bof $X^\mu$ only implies periodicity of $\hat{X}^\mu$ for $\alpha=0$
How does this proceed?
EDIT: Even if I ignore $(4)$ as bolbteppa suggested, I have the same problem if I use$$\delta X^\mu(\tau,\sigma) = X^{\prime \mu}(\tau, \sigma) - X^\mu (\tau, \sigma)$$
It seems to me that I need to impose periodicity of $ X^{\prime \mu}$, which is not mentioned in he book.
The textbook I'm using is Polchinski's String Theory Vol.1 An Introduction to the Bosonic String Theory