Made our XML parser more robust (also added new private function
validCoordCheck() to avoid duplicate code when checking for correct
coordinates)