yang_dnode_xpath_get_value(const struct lyd_node *dnode, const char *xpath_fmt,
			   va_list ap)
{
	const struct lyd_node_term *__dleaf =
		(const struct lyd_node_term *)dnode;
	assert(__dleaf);
	if (xpath_fmt) {
		char __xpath[XPATH_MAXLEN];
		vsnprintf(__xpath, sizeof(__xpath), xpath_fmt, ap);
		__dleaf = (const struct lyd_node_term *)yang_dnode_get(dnode,
								       __xpath);
		YANG_DNODE_GET_ASSERT(__dleaf, __xpath);
	}
	const struct lyd_value *__dvalue = &__dleaf->value;
	if (__dvalue->realtype->basetype == LY_TYPE_UNION)
		__dvalue = &__dvalue->subvalue->value;
	return __dvalue;
}
yang_dnode_xpath_get_value(const struct lyd_node *dnode, const char *xpath_fmt,
			   va_list ap)
{
	const struct lyd_node_term *__dleaf =
		(const struct lyd_node_term *)dnode;
	assert(__dleaf);
	if (xpath_fmt) {
		char __xpath[XPATH_MAXLEN];
		vsnprintf(__xpath, sizeof(__xpath), xpath_fmt, ap);
		__dleaf = (const struct lyd_node_term *)yang_dnode_get(dnode,
								       __xpath);
		YANG_DNODE_GET_ASSERT(__dleaf, __xpath);
	}
	const struct lyd_value *__dvalue = &__dleaf->value;
	if (__dvalue->realtype->basetype == LY_TYPE_UNION)
		__dvalue = &__dvalue->subvalue->value;
	return __dvalue;
}