added xml process error checking and error mail sending