Equivalence to Smith form of a class of multivariate polynomial matrices