Gradle nested extention with dynamic name

I would like to create a custom extension with some dynamic name as

myExt {
  "aNameChoosenByUser"{
    firstname = 'toto'
    age
     = 2
  }
  "aNameChoosenByUser2"{
    firstname = 'tata'
    age
     = 3
  }
}

I use usually: project.extensions.create(“myExt”, APluginExtension) All choosen name has the same type Person as example. I would like lto iterate as it was a HashMap<String,Person> .

It is possible to do it with groovy/gradle ?

thanks

This question has been answered on stackoverflow.