Not really a solution to your problem, sorry, but nowadays it is recommended to use xml2 instead, because XML isn't actively maintained (so you might get other problems with it once you succeed in installing it).
Now, obviously, if you're trying to re-use some older code where XML was used, switching to xml2 will require a bit of work. @nuest wrote an useful gist about migration from XML to xml2.