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