With modern libraries, there is (or should be) no need to hard-code an install path (what if libxml2 is in /opt, or /usr/local/libxml2, or wherever?). Instead, libxml2 makes use of pkg-config, so you should use:
when building, and
pkg-config libxml-2.0 --cflags
when linking. This takes care of include and library paths, and library names.
pkg-config libxml-2.0 --libs
If your system doesn't have pkg-config, libxml2 should also come with xml2-config, which performs the same function.
pkg-config allows multiple packages to be specified, which is very handy:
Duplicate entries are merged into one (so if all set -I/usr/local/include, this is only output once).
pkg-config libfoo libbar libbaz --cflags
In GNU make, for example, you could do:
Encourage library authors to use pkg-config! Encourage library users to use pkg-config!
PACKAGES= libxml-2.0 imlib2 x11
CFLAGS+= $(shell pkg-config $(PACKAGES) --cflags)
LDADD+= $(shell pkg-config $(PACKAGES) --libs)