How to hide inactive categories in sitemap.xml?

Hi,
how can I modify the generated sitemap (sitemap:generate) to hide inactive categories. If I click on the link in the sitemap.xml I get a 404 page.

normally hidden categories won’t be displayed , however you can write a CustomUrlProvider