I have previously forgotten about the following utility function as described in the confd_lib_lib section of the ConfD User Guide which can be used if the schema information has been loaded from the ConfD daemon into the ConfD client library:
int confd_val2str(struct confd_type *type, const confd_value_t *val, char *buf, int bufsiz);
Prints the string representation of val into buf, which has the length bufsiz, using type information from the data model. Returns the length of the string as described for confd_pp_value(), or CONFD_ERR if the value could not be converted (e.g. wrong type). The type pointer can be obtained either from the struct confd_cs_node corresponding to the leaf that val pertains to, or via the confd_find_ns_type() function above. The struct confd_cs_node can in turn be obtained by variouscombinations of the functions that operate on the confd_cs_node trees (see above), or by user-defined functions for navigating those trees. Requires that schema information has been loaded from the ConfD daemon into the library, see confd_types(3).