checking for xmlMode before outputting