A commutator method for the diagonalization of Hankel operators