Is any one familiar with generating .jmx file automatically?

I have used selenium+junit+jmeter. From that, I get the classname in JMeter. Based on the requirement, I can able to create the .jmx file by using that classname. All of these are done manually.

Suppose, if I add any new class in selenium, I can get that class from the jar file. After that, I need to put that jar in jmeter/lib/junit directory. Again, I need to create the .jmx file from jmeter gui.

Instead of creating .jmx file manually, how to create the .jmx file automatically while adding any new classes in selenium?

For example, if I add a "create" class in selenium junit, then the jmeter will automatically generate the "create.jmx" file for that class.

Is there any API for that? Please let me know the possibility of doing the above.

Awaiting for your reply.