Libxml includes a script, xml2-config, that can be used to generate flags for compilation and linking of programs written with the library. For pre-processor and compiler flags, use xml2-config --cflags. For library linking flags, use xml2-config --libs. Other options are available using xml2-config --help.