How to Create testng.xml from java code

But testng.xml already does perfect parallel, I don’t want to deal with hub and nodes…
I just want help to be able to edit the testng.xml moment before running it and to edit the device amount/test ls amount…