wrap apply xml measure in exception catch