It sounds like you want to be able to use functionality from sitemap.php in your cakephp application. The bet way to include this in cakephp is by setting it up as a vendor. Follow these steps:
1- Put the file in the app/vendor folder.
2- To use the file in a controller (or anywhere else), add:
App::import('Vendor','sitemap');
If it is just a file with a list of functions, you can now simply call the functions as you would in any other PHP file. So if you have a function called show_links() for example, in the controller where you have imported the vendor/sitemap, you simply put:
show_links();
If it is a class, then you will need to instantiate the class and use it like you would anywhere else:
App::import('Vendor','sitemap');
$sitemap = new Sitemap;
$sitemap->show_links();
So, now you are ready to set up the route to include the sitemap functionality in the config/routes.php file:
Router::connect('/sitemap.xml', array('controller' => 'YOUR_CONTROLLER', 'action' => 'YOUR_ACTION'));
This will process the sequence of code contained in the action that will then play off the sitemap.php file.
So in a nutshell, you would see something like this:
<?php
class SiteMapController extends AppController
{
var $name = 'Tests';
function show_map()
{
App::import('Vendor','sitemap');
$sitemap = new Sitemap;
$sitemap->show_links();
}
}
?>
And in the config/routes.php you would add:
Router::connect('/sitemap.xml', array('controller' => 'site_maps', 'action' => 'show_map'));
Then, when you visit the url:
http://mysite/sitemap.xml
It will route to:
http://mysite/site_maps/show_map
For more information on routing, you can visit: http://book.cakephp.org/view/542/Defining-Routes
Good luck and Happy Coding!
UPDATED!