We create a TBB to generate web sitemap XML. The problem is if a page is published in child publication, but not published in parent publication. when we generate the sitemap XML in parent publication, it will be in. But we expect it will not in the parent publication sitemap XML because this page is not published.

The code to generate the xml is:
[![enter image description here](https://i.stack.imgur.com/kcry5.png)](https://i.stack.imgur.com/kcry5.png)