Another possibility is to use `libbsdxml`, a renamed expat that FreeBSD includes (although the man page says that “The libbsdxml library is intended to be used within the FreeBSD base system only. Use of the libbsdxml library for other purposes is not supported and discouraged.” But expat’s API is quite stable, and avahi also has the option to use bsdxml.)
Otherwise, maybe just depend on a system-installed expat or libxml2 on FreeBSD?