Installing a package to build some code is just fundamentally wrong, though. Why am I making unspecified, permanent changes to my underlying operating system in order to build a random piece of code?
That just make no sense, and it is insane that this is the standard way of doing things.
Install in context of library package manager doesn't necessarily mean install to operating system. It can be just caching it somewhere in your home directory.
Part of the problem is, packages have different names on different systems, and many are missing altogether (is it libxml-dev or libxml-devel or does your OS simply not have that package, because the package repository owners are in a state of gang warfare with the libxml devs?)