Giving custom argument value in 'q' variable We want to use  a custom template page when a specific value is given for the q variable in url . 

For example if we give http://localhost/drupal/?q=xyz/123   , we want to use a custom template page say page-xyz.tpl.php .. 

Have a hunch that hooks and template.php file may be the key components here but not sure what to exactly do.
Your question seem a little bit unclear to me. But my understanding is that you are having problems with theme template.

You should try it out using the node in your url. There is an example...

If you had the following path:

/node/99/edit


PHPtemplate looks for the following templates, in descending order:

page-node-edit.tpl.php
page-node-99.tpl.php
page-node.tpl.php
page.tpl.php