cmake: Add FindXerces support and correct minor portability problems

- Add FindXerces to allow proper discover of Xerces-C++; in particular needed on Windows
- Correct a number of cases of incorrect path usage
- Now builds on platforms where the libraries and headers are not on the standard search path
- Configure, build and tests now work on FreeBSD

--no-rebase

--------

Testing:

- jobs should remain green
- now possible to build with Xerces on nonstandard paths, but this is hard to test on Linux or MacOS since the paths are standard (I tested on FreeBSD with the `textproc/xerces-c3` port and `CMAKE_PREFIX_PATH=/usr/local`), so maybe just rely on the green jobs :)
This is deliberate.  They should all be `Xerces_` but this requires cmake >= 3.0, but this is very new and we need to support cmake 2.8 since this is what all the stable releases of all current Linux distributions provide (Windows, MacOSX/homebrew and BSD ports are now all version 3.x).  The macro which sets XERCES_FOUND uppercases the package name with cmake 2.8; the argument to specify the mixed case form was only added for cmake 3.0, so I had to back this out.