  We extend beyond the Euler scales the hydrodynamic theory for quantum and
classical integrable models developed in recent years, accounting for diffusive
dynamics and local entropy production. We review how the diffusive scale can be
reached via a gradient expansion of the expectation values of the conserved
fields and how the coefficients of the expansion can be computed via integrated
steady-state two-point correlation functions, emphasising that PT-symmetry can
fully fix the inherent ambiguity in the definition of conserved fields at the
diffusive scale. We develop a form factor expansion to compute such correlation
functions and we show that, while the dynamics at the Euler scale is completely
determined by the density of single quasiparticle excitations on top of the
local steady state, diffusion is due to scattering processes among
quasiparticles, which are only present in truly interacting systems. We then
show that only two-quasiparticle scattering processes contribute to the
diffusive dynamics. Finally we employ the theory to compute the exact spin
diffusion constant of a gapped XXZ spin-1/2 chain at finite temperature and
half-filling, where we show that spin transport is purely diffusive.
