applied patch for replaceNode from Brent Hendricks Daniel

* tree.c: applied patch for replaceNode from Brent Hendricks
Daniel
diff --git a/tree.c b/tree.c
index eb988ab..a040ba3 100644
--- a/tree.c
+++ b/tree.c
@@ -3469,7 +3469,7 @@
 	return(old);
     }
     xmlUnlinkNode(cur);
-    cur->doc = old->doc;
+    xmlSetTreeDoc(cur, old->doc);
     cur->parent = old->parent;
     cur->next = old->next;
     if (cur->next != NULL)