fixed a bug when walking the descendants and the current node has no

* xpath.c: fixed a bug when walking the descendants and
  the current node has no children
* debugXML.c: show up when a text node is supposed to not be escaped
Daniel
diff --git a/xpath.c b/xpath.c
index 51899ea..1c8c1a8 100644
--- a/xpath.c
+++ b/xpath.c
@@ -4607,11 +4607,13 @@
         return(ctxt->context->node->children);
     }
 
-    if (cur->children != NULL)
-    	{
+    if (cur->children != NULL) {
     	if (cur->children->type != XML_ENTITY_DECL)
-		   	return(cur->children);
-    	}
+	    return(cur->children);
+    }
+
+    if (cur == ctxt->context->node) return(NULL);
+
     if (cur->next != NULL) return(cur->next);
     
     do {