diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c
index 5ced182d3c4debdcdcb5949b756cc111a1bb1113..01f1976ab610d676c82a0746e31b8b403f439edf 100644
--- a/contrib/xml2/xpath.c
+++ b/contrib/xml2/xpath.c
@@ -16,6 +16,9 @@
 #include <libxml/xmlerror.h>
 #include <libxml/parserInternals.h>
 
+
+PG_MODULE_MAGIC;
+
 /* declarations */
 
 static void *pgxml_palloc(size_t size);
diff --git a/contrib/xml2/xslt_proc.c b/contrib/xml2/xslt_proc.c
index 404aa2a79071ab4cb09a31767bbce559967ec1b1..433030ead96f5002fb3f7dcfa8ae79867d429a84 100644
--- a/contrib/xml2/xslt_proc.c
+++ b/contrib/xml2/xslt_proc.c
@@ -21,8 +21,6 @@
 #include <libxslt/xsltutils.h>
 
 
-PG_MODULE_MAGIC;
-
 /* declarations to come from xpath.c */
 
 extern void elog_error(int level, char *explain, int force);