See #2, #1385 for context. This is the RSS generation part, building on PR #1930. It contains the logic for generating RSS This was originally in #1385 and #1565, split out for ease of review