Fix compilation and warning problems when disabling libxml2 and/or OGR