{var $comments = $_modx->getResources(
    ['published' => 1, 'deleted' => 0],
    ['parents' => 54, 'sortby' => 'publishedon', 'sortdir' => 'DESC', 'limit' => 0]
)}
{var $comments__ids}
    {foreach $comments as $comments__item}
        {if $comments__item@last}-{$comments__item.id}{else}-{$comments__item.id},{/if}
    {/foreach}
{/var}

{'pdoResources' | snippet : [
	'limit' => 0,
	'parents' => '0',
	'resources' => '-2,-3,-4,-5,-6,-15,-9,-48,-65,' ~ $comments__ids,
	'_includeTVs' => 'smap_priority,smap_changefreq',
	'tplWrapper' => '@INLINE <?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">{$output}</urlset>',
	'tpl' => '@INLINE <url>
    	<loc>{if $alias == \'index\'}{\'site_url\' | config}{else}{$id | url : [\'scheme\' => \'full\']}{/if}</loc>
    	<lastmod>{if $editedon != 0}{$editedon | date_format:\'%Y-%m-%dT%H:%M:%S+03:00\'}{else}{$createdon | date_format:\'%Y-%m-%dT%H:%M:%S+03:00\'}{/if}</lastmod>
    	<changefreq>{$smap_changefreq ?: \'daily\'}</changefreq>
    	<priority>{if $template == 4}{$smap_priority ?: \'0.3\'}{else}{$smap_priority ?: \'1.0\'}{/if}</priority>
    </url>'
]}