--- ./entities.c.orig	2024-07-24 09:00:51.000000000 -0500
+++ ./entities.c	2026-04-16 17:16:22.143013559 -0500
@@ -28,6 +28,7 @@
 
 #include "private/entities.h"
 #include "private/error.h"
+#include "private/tree.h"
 
 /*
  * The XML predefined entities.
@@ -981,6 +982,13 @@
 	cur->orig = xmlStrdup(ent->orig);
     if (ent->URI != NULL)
 	cur->URI = xmlStrdup(ent->URI);
+    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
+    if (ent->children != NULL) {
+        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
+        /* Update last pointers */
+        cur->last = cur->children;
+        while (cur->last && cur->last->next) cur->last = cur->last->next;
+    }
     return(cur);
 }
 
