I had a similar issue yesterday after upgrading to R 4.0 on Catalina . You dont show it in your error but I believe the install of xml2 is being done from source. I had to reinstall xcode before it would work.
Open a terminal prompt and run xcode-select --install (two hyphens before install). Then rerun your install in R