Fix:

docObj.c:124:60: error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]

https://cgit.freebsd.org/ports/commit/?id=af36765e17ba36d0e86e95d4476b67f894209468
--- docObj.c.orig
+++ docObj.c
@@ -1729,9 +1729,13 @@
 }
 
 void
-TclXML_libxml2_ErrorHandler (ctx, error)
-     void *ctx; /* ignore - depends on context */
-     xmlErrorPtr error;
+TclXML_libxml2_ErrorHandler (void *ctx,
+#if LIBXML_VERSION >= 21200
+        const xmlError *error
+#else
+        xmlError *error
+#endif
+        )
 {
   ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
   Tcl_Obj *objPtr;
--- include/tclxml-libxml2/tclxml-libxml2Decls.h.orig
+++ include/tclxml-libxml2/tclxml-libxml2Decls.h
@@ -55,7 +55,12 @@
 				TclXML_libxml2_DocumentHandling keep));
 /* 10 */
 EXTERN void		TclXML_libxml2_ErrorHandler _ANSI_ARGS_((void * ctx, 
-				xmlErrorPtr error));
+#if LIBXML_VERSION >= 21200
+				const xmlError *error));
+#else
+				xmlError *error));
+#endif
+
 /* 11 */
 EXTERN void		TclXML_libxml2_ResetError _ANSI_ARGS_((
 				Tcl_Interp * interp));
@@ -81,7 +86,13 @@
     int (*tclXML_libxml2_GetTclDocFromNode) _ANSI_ARGS_((Tcl_Interp * interp, xmlNodePtr nodePtr, TclXML_libxml2_Document ** tDocPtrPtr)); /* 7 */
     void (*tclXML_libxml2_DestroyDocument) _ANSI_ARGS_((TclXML_libxml2_Document * tDocPtr)); /* 8 */
     void (*tclXML_libxml2_DocKeep) _ANSI_ARGS_((Tcl_Obj * objPtr, TclXML_libxml2_DocumentHandling keep)); /* 9 */
-    void (*tclXML_libxml2_ErrorHandler) _ANSI_ARGS_((void * ctx, xmlErrorPtr error)); /* 10 */
+    void (*tclXML_libxml2_ErrorHandler) _ANSI_ARGS_((void * ctx,
+#if LIBXML_VERSION >= 21200
+                const xmlError * error
+#else
+                xmlError * error
+#endif
+                )); /* 10 */
     void (*tclXML_libxml2_ResetError) _ANSI_ARGS_((Tcl_Interp * interp)); /* 11 */
     Tcl_Obj * (*tclXML_libxml2_GetErrorObj) _ANSI_ARGS_((Tcl_Interp * interp)); /* 12 */
     void (*tclXML_libxml2_SetErrorNodeFunc) _ANSI_ARGS_((Tcl_Interp * interp, TclXML_ErrorNodeHandlerProc * proc)); /* 13 */
