**Abstract** : We combine Bethe ansatz and field theory methods to study the longitudinal dynamical structure factor Szz(q,ω) for the anisotropic spin-1/2 chain in the gapless regime. Using bosonization, we derive a low-energy effective model, including the leading irrelevant operators (band curvature terms) which account for boson decay processes. The coupling constants of the effective model for finite anisotropy and finite magnetic field are determined exactly by comparison with corrections to thermodynamic quantities calculated by Bethe ansatz. We show that a good approximation for the shape of the on-shell peak of Szz(q,ω) in the interacting case is obtained by rescaling the result for free fermions by certain coefficients extracted from the effective Hamiltonian. In particular, the width of the on-shell peak is argued to scale like δωq~q2 and this prediction is shown to agree with the width of the two-particle continuum at finite fields calculated from the Bethe ansatz equations. An exception to the q2 scaling is found at finite field and large anisotropy parameter (near the isotropic point). We also present the calculation of the high-frequency tail of Szz(q,ω) in the region using finite-order perturbation theory in the band curvature terms. Both the width of the on-shell peak and the high-frequency tail are compared with Szz(q,ω) calculated by Bethe ansatz for finite chains using determinant expressions for the form factors and excellent agreement is obtained. Finally, the accuracy of the form factors is checked against the exact first moment sum rule and the static structure factor calculated by density matrix renormalization group (DMRG).