Correlation Functions of the Quantum Sine-Gordon Model in and out of Equilibrium