diff --git a/contrib/xml2/Makefile b/contrib/xml2/Makefile
index 5fdcc9fcd04938c91c209b72e04094645cc2ae0a..0bd5b032976c790e070df682531a7cedd9dd5362 100644
--- a/contrib/xml2/Makefile
+++ b/contrib/xml2/Makefile
@@ -6,7 +6,7 @@ MODULE_big = pgxml
 OBJS = xpath.o xslt_proc.o
 
 # Remove -lxslt from the following line if you don't have libxslt.
-SHLIB_LINK = -lxml2 -lxslt
+SHLIB_LINK = -lxslt -lxml2
 
 DATA_built = pgxml.sql
 DATA = uninstall_pgxml.sql