It seems you are right. I did not see that at first. It seems the R installation is using the python libxml2 installation. It may not be the same. You should check that.
You may be able to use environment variable to precise the path to your libxml library to change the one change by pkg-config
There are also other environment variables that could be used to configure the compilation.
like https://github.com/omegahat/XML/blob/1200e8d2e2cd4910537b700245c9d58350c3e351/configure#L3116
I did not find a lot of documentation for changing the default.
I guess you can also change you pkgconfig configuration so that the python one is not found by default.
For xml2, the configuration can use --configure-vars installation option, to precise INCLUDE_DIR and LIB_DIR (see configure too)
Hope you'll find how to do this. I think you are on the right track.