Analytic Surgery of the Zeta Function