Seems that get_sorted_structure()
supports passing a callable. Will probably end up using or modifying this since the callable must take a single argument. I.e. the lexicographic aspect would need to either be a modification to the fn or embedded into the callable. Will post back once implemented.