Do we have any structure or API in cdb using which i can know leaf names

use case is - I want to generate a csv file with header as leaf names and value in corresponding column.

suppose my container is -
container {
list values {
key “a b”
leaf a
leaf b
leaf c
}
}

Now in CDB i have
a b c
3 4 5
4 4 5
4 5 6

Now I want to generate CSV in same format as above by reading data from CDB.
So to generate file header leaf name should be know to application.

See for example the print_modifications examples here:

and here:

Can you please give the samples. I dont have.

I believe all the example code you need are in the postings I pointed to when used together with the 1-2-3 intro example that comes with the ConfD example set.