I'm using htaccess coppied from wordpress.

RewriteCond % !-f
RewriteCond % !-d
RewriteRule . index.php [L]

It really works fine.

I must give a script to redirect to sitemap.php file if user demands sitemap.xml.

I attempted adding RewriteCond %{REQUEST_FILENAME} !-^sitemap.xml$ but did not work.

Place the rule BEFORE that algorithm:

RewriteRule sitemap\.xml sitemap.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]