xml is nothing else then a file with data. You can do an xml using php functions like fwrite, fopen and just write in that file structure of xml
Actually you can create XML for your website depends on your requirement like, Creating RSS Feed, Sitemap and widgets.
Do you mean how to create XML sitemaps? You can check the tutorials at http://www.xml-sitemaps-generator.com