Factorization of multiple integrals representing the density matrix of a finite segment of the Heisenberg spin chain