Search engines like Google and Bing want us to submit sitemap file in webmaster tools so that they can use it to crawl and analyze our website. If you still have pure HTML based website during 90's and early 00's, most likely you have to run sitemap generator software from PC, crawling and collecting urls from your web pages and save into a sitemap file. The major problem is you need to generate new sitemap file every now and then when you update your website, then upload to webmaster tools.
With Joomla, you can use Xmap, a free component created by Guillermo Vargas since Joomla 1.x, to re-generate dynamic sitemap automatically so that you can totally forget about sitemap file after initial setup. Xmap creates sitemap based on the structure of menus in your Joomla website. You can add or remove menus anytime and Xmap will dynamically generate sitemap accordingly with additional metadata. You can also create any number of sitemaps with different options. However, Xmap also comes with poor documentation and poor support, as you can see from JED comments. If you encounter any problems, you need to search the solution from forums, just like Xmap was not functional in recent Joomla 3.2 upgrade.
After installing Xmap component, you will see setup below.
Before using Xmap, you need to turn on relevant plugins. Xmap comes with plugin for several companents, such as K2, Kunena, Moset, SobiPro etc. If you are using Virtuemart to create online shopping website, you need to activate Virtuemart plugin so that Xmap can generate sitemap with product urls from Virtuemart component. If your component's plugin is not come together with Xmap package, then you might want to download from JED or component website. For example, you can download Easyblog plugin for Xmap from stackideas.com. Worst case, write your own plugin for Xmap!
Click on XML Sitemap at Xmap component and you will see urls of your website.
Then submit to search engine webmasters tools for indexing.
However, if you have a website with large content, you might get error 500 from Xmap most likely too much time taken to generate sitemap file. Google webmasters tools can only take maximum of 50,000 Urls per file or 50Mb per file size or total of 500 sitemap files. For example, one of my website with 120,000++ urls breaks Xmap and Google webmasters tools. So I have to write a script to generate sitemap files, with each about 40,000 urls.