Add custom URLs to WordPress’s XML sitemap

My WordPress site also incorporates some external non-WP content that is dynamically pulled into the page via shortcode. The content shown depends on a query string parameter. So from WP’s point of view, index is just a single page containing a shortcode; but in reality, when you visit index?x=1, index?x=2, index?x=3, etc. you get different page content depending on the x value. (It’s a primary key ID into a large external database.)