Magnetic ordering and dynamics in the XY pyrochlore antiferromagnet: a muon-spin relaxation study of Er2Ti2O7and Er2Sn2O7