+static int register_lttng_namespace(xmlXPathContextPtr xpathCtx)
+{
+ int ret;
+ xmlChar *prefix;
+ xmlChar *ns = NULL;
+
+ prefix = xmlCharStrdup("lttng");
+ if (!prefix) {
+ ret = -1;
+ goto end;
+ }
+
+ ns = xmlCharStrdup(DEFAULT_LTTNG_MI_NAMESPACE);
+ if (!ns) {
+ ret = -1;
+ goto end;
+ }
+
+ ret = xmlXPathRegisterNs(xpathCtx, prefix, ns);
+ xmlFree(prefix);
+end:
+ xmlFree(ns);
+ return ret;
+}
+