testng-xml-maker-maven-plugin will help you generate testng-xml-file from environment variables. Mainly used with parametrized Jenkins job.
Use this plugin in your code,
==MAVEN:
<dependency>
    <groupId>in.mayurshah</groupId>
    <artifactId>testng-xml-maker-maven-plugin</artifactId>
    <version>1.0.1</version>
</dependency>