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 :)