correction of end xml