Added checks to make sure files exist before including them in the xmlResult