}
+/**
+ * virXPathTristateSwitch:
+ * @xpath: the XPath string to evaluate
+ * @ctxt: an XPath context
+ * @value: the returned virTristateSwitch value
+ *
+ * Convenience function to evaluate an XPath tristate value. The @xpath
+ * expression must ensure that the evaluated value is returned as a
+ * string (use the 'string()' conversion in the expression).
+ *
+ * Returns 0 in case of success in which case @value is set,
+ * or -1 if the XPath evaluation failed or -2 if the
+ * value isn't of a virTristateSwitch value.
+ */
+int
+virXPathTristateSwitch(const char *xpath,
+ xmlXPathContextPtr ctxt,
+ virTristateSwitch *value)
+{
+ g_autoptr(xmlXPathObject) obj = NULL;
+ int rc;
+
+ if (!(obj = virXPathEvalString(xpath, ctxt)))
+ return -1;
+
+ rc = virTristateSwitchTypeFromString((char *)obj->stringval);
+ if (rc < 0)
+ return -2;
+
+ *value = rc;
+ return 0;
+}
+
+
/**
* virXMLCheckIllegalChars:
* @nodeName: Name of checked node
xmlXPathContextPtr ctxt,
long long *value);
+int
+virXPathTristateSwitch(const char *xpath,
+ xmlXPathContextPtr ctxt,
+ virTristateSwitch *value);
+
xmlNodePtr
virXMLNodeGetSubelement(xmlNodePtr node,
const char *name);