This question has been answered by multiple community members. See the first response.
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="https://www.google.com/schemas/sitemap/0.84"> [[getResources? &parents=`0` &tpl=`google-sitemap-tpl` &limit=`5000` &sortdir=`DESC` &includeTVs=`1` &processTVs=`1` &depth=`20` &sortby=`publishedon` ]] </urlset>
<?php
$c = array(
'hidemenu:=' => '1',
'class_key:!=' => 'Article',
'published:=' => '1'
);
$docs = $modx->getCollection('modResource', $c);
foreach ($docs as $doc) {
$ids[] = $doc->get('id');
$output .= "<br>" . $doc->get('pagetitle') . ' (' . $doc->get('id') . ')';
}
$output .= '<br><p style="overflow:scroll">' . implode(',', $ids) . '</p>';
return $output;