Add trailing slash to URLs when generating Sitemap with Simple XML sitemap
You can use hook_simple_sitemap_links_alter() to change the links generated before the sitemap is saved.

function example_simple_sitemap_links_alter(&amp;$links) {
  global $base_url;
  foreach ($links as $key =&gt; $link) {
    if ($links[$key]['url'] != $base_url . '/') { // Excluding base url
      $links[$key]['url'] = $link['url'] . '/'; // Here Trailing slash will be added
    }
  }
}


Before using the hook:



After using the hook: