Microscopic dynamic calculations of collective states in xenon and barium isotopes