I want to create test reports generated by JUnit / TestNG PROGRAMMATICALLY. So, that rules out ANT. My main concern is to generate XML files which are created by Junit while
As being mentioned JUnit does not generate reports. But if you use Maven executing mvn clean install test surefire-report:report will do the trick
mvn clean install test surefire-report:report
https://examples.javacodegeeks.com/core-java/junit/junit-report-generation-example/