diff --git a/debugXML.c b/debugXML.c
--- a/debugXML.c
+++ b/debugXML.c
@@ -1724,8 +1724,12 @@
 
     switch (node->type) {
 	case XML_ELEMENT_NODE:
-	    if (node->name != NULL)
+	    if (node->name != NULL) {
+                if (node->ns != NULL)
+                    fprintf(output, "%s:", node->ns->prefix?
+                            (const char*) node->ns->prefix : "?");
 		fprintf(output, "%s", (const char *) node->name);
+            }
 	    break;
 	case XML_ATTRIBUTE_NODE:
 	    if (node->name != NULL)
@@ -2696,6 +2700,9 @@
         } else if (node->type == XML_ELEMENT_NODE) {
             for (i = 0; i < indent; i++)
                 fprintf(ctxt->output, "  ");
+            if(node->ns)
+                fprintf(ctxt->output, "%s:", node->ns->prefix?
+                        (const char*) node->ns->prefix : "?");
             fprintf(ctxt->output, "%s\n", node->name);
         } else {
         }
@@ -2837,6 +2844,12 @@
     while (1) {
         if (ctxt->node == (xmlNodePtr) ctxt->doc)
             snprintf(prompt, sizeof(prompt), "%s > ", "/");
+        else if ((ctxt->node != NULL) && (ctxt->node->name)
+                 && (ctxt->node->ns))
+            snprintf(prompt, sizeof(prompt), "%s:%s > ",
+                     (ctxt->node->ns->prefix?
+                      (const char *) ctxt->node->ns->prefix : "?"),
+                     ctxt->node->name);
         else if ((ctxt->node != NULL) && (ctxt->node->name))
             snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name);
         else
@@ -2960,7 +2973,79 @@
             if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
                 fprintf(ctxt->output, "%s\n", dir);
         } else if (!strcmp(command, "du")) {
-            xmlShellDu(ctxt, NULL, ctxt->node, NULL);
+            if (arg[0] == 0) {
+                xmlShellDu(ctxt, NULL, ctxt->node, NULL);
+            } else {
+                ctxt->pctxt->node = ctxt->node;
+#ifdef LIBXML_XPATH_ENABLED
+                ctxt->pctxt->node = ctxt->node;
+                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
+#else
+                list = NULL;
+#endif /* LIBXML_XPATH_ENABLED */
+                if (list != NULL) {
+                    switch (list->type) {
+                        case XPATH_UNDEFINED:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s: no such node\n", arg);
+                            break;
+                        case XPATH_NODESET:{
+                                int indx;
+
+				if (list->nodesetval == NULL)
+				    break;
+
+                                for (indx = 0;
+                                     indx < list->nodesetval->nodeNr;
+                                     indx++) 
+                                    xmlShellDu(ctxt, NULL,
+                                               list->nodesetval->
+                                               nodeTab[indx], NULL);
+                                break;
+                            }
+                        case XPATH_BOOLEAN:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is a Boolean\n", arg);
+                            break;
+                        case XPATH_NUMBER:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is a number\n", arg);
+                            break;
+                        case XPATH_STRING:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is a string\n", arg);
+                            break;
+                        case XPATH_POINT:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is a point\n", arg);
+                            break;
+                        case XPATH_RANGE:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is a range\n", arg);
+                            break;
+                        case XPATH_LOCATIONSET:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is a range\n", arg);
+                            break;
+                        case XPATH_USERS:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is user-defined\n", arg);
+                            break;
+                        case XPATH_XSLT_TREE:
+                            xmlGenericError(xmlGenericErrorContext,
+                                            "%s is an XSLT value tree\n",
+                                            arg);
+                            break;
+                    }
+#ifdef LIBXML_XPATH_ENABLED
+                    xmlXPathFreeObject(list);
+#endif
+                } else {
+                    xmlGenericError(xmlGenericErrorContext,
+                                    "%s: no such node\n", arg);
+                }
+                ctxt->pctxt->node = NULL;
+            }
         } else if (!strcmp(command, "base")) {
             xmlShellBase(ctxt, NULL, ctxt->node, NULL);
         } else if (!strcmp(command, "set")) {
