Question2Answer ships with a plugin for creating an XML sitemap. Enable the plugin under Administration center - plugins and the sitemap is automatically generated. The path to the sitemap follows the URL structure defined in Administration center - general:
- /123/why-do-birds-sing → /sitemap.xml
- /index.php/123/why-do-birds-sing → /index.php/sitemap.xml
- /?qa=123/why-do-birds-sing → /?qa=sitemap.xml
- /?qa=123&qa_1=why-do-birds-sing → /?qa=sitemap.xml
- /index.php?qa=123&qa_1=why-do-birds-sing → /index.php?qa=sitemap.xml
For the latter 4 URL structures you can make the sitemap accessible as /sitemap.xml (like the first URL structure) by adding that as a separate location to your web server config.
The default sitemap plugin has some limitations, though. If your sitemap grows beyond 50,000 entries you may need to find a different plugin. There is for instance https://question2answer.org/qa/90798/free-sitemap-enhance (haven't used it myself, so take with a grain of salt).