In order to convert a dictionary of dictionaries
into an array of dictionaries
without losing the key, the first step is to put the key into the dictionary. In other words, you need to convert this
Root
AED
name "some name"
objects ...
ARS
name "other name"
objects ...
to this
Root
AED
name "some name"
objects ...
key "AED"
ARS
name "other name"
objects ...
key "ARS"
and then call allValues
and sort the resulting array.