Description: Mark parent XMLNodes.
Author: Benjamin Wolsey <bwy@benjaminwolsey.de>
Bug: https://savannah.gnu.org/bugs/?31044

--- a/libcore/asobj/XMLNode_as.cpp
+++ b/libcore/asobj/XMLNode_as.cpp
@@ -465,6 +465,11 @@
 void
 XMLNode_as::setReachable() 
 {
+    // If there is a parent, make sure its object is reachable. This goes
+    // up towards the root node of tree without marking the XMLNode
+    // resources (which would cause infinite recursion).
+    if (_parent && _parent->_object) _parent->_object->setReachable();
+
 	// Mark children
     std::for_each(_children.begin(), _children.end(),
             boost::mem_fn(&XMLNode_as::setReachable));
