Different Robot.txt And Sitmap.xml Depends O Domain..

I dont know too much about robots.txt and sitmap.xml

I have one web application which has different domain share same code …

domain are loaded like

http::/www.test.com?domain=test1.com

http::/www.test.com?domain=test2.com

and so on…

How can i load robots.txt and sitmap.xml depends on domain…

i want to add directory structure like this

robots/test1.com/robots.txt

robots/test2.com/robots.txt

so depends on domain above robots.txt will be indexed …

where and how to set file path .?? is it possible to set path …