Autofill form programatically

How can I travese in form list and autofill some values.

In the old version there used to be something like below.

FormInstance instance = formController.getInstance();
 TreeElement treeElement = instance.getRoot();

But looks like it has been updated.

Maybe you are looking for select widget with autocomplete. See the docs for details: https://docs.getodk.org/form-question-types/#select-widget-with-autocomplete

Actually I was looking something different.
I got the solution BTW. We can check the formkey at runtime and fill the value baseed on our requirements.