There should be some way to get the system to actually load the newer version of libxml2 from a "keg"
Thank you for explaining the situation. I barely grasp the problem, let alone the solution. I find people on other sites fixing similar sounding issues with the command:
brew link --force libxml2
I tried it to see what happens:
brew link --dry-run libxml2
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile
/usr/local/include/libxml2 looks interesting because I don't have it and can't find those links when looking for some of them. But I do have /usr/bin/xmllint already:
xmllint: using libxml version 20904
I don't know what forcing that link will do to the system, what it will break, how to unforce...