Skip to content

RSS & Atom Feeds — XML Syndication Guide

DodaTech Updated 2026-06-20 10 min read

In this tutorial, you'll learn about RSS & Atom Feeds. We cover key concepts, practical examples, and best practices.

RSS and Atom are XML-based web feed formats that syndicate articles and podcasts in a machine-readable format consumed by feed readers and aggregators worldwide.

What You'll Learn

  • The XML structure of RSS 2.0 and Atom 1.0 feeds
  • Required and optional channel/item elements with real examples
  • How to generate, validate, and consume web feeds programmatically
  • Security considerations when processing external feeds

Why It Matters

Web feeds power podcast distribution, news aggregation, blog subscriptions, and automated content pipelines. Understanding the XML structure of RSS and Atom lets you build custom feed generators, integrate content into your applications, and process millions of feed entries efficiently — exactly how DodaZIP handles batch feed processing for content archiving.

Learning Path

flowchart LR
  A[XML Basics] --> B[XML vs JSON vs YAML]
  B --> C[RSS & Atom Feeds
You are here] C --> D[XML Configuration Files] D --> E[XML Web Services]

What Are Web Feeds?

A web feed is an XML document that contains a list of items — blog posts, news articles, podcast episodes, or any regularly updated content. Feed readers (like Feedly, Inoreader, or Thunderbird) poll these XML URLs periodically and display new content to subscribers.

Think of a feed as a table of contents that updates automatically. Instead of visiting ten websites every morning to check for new articles, you subscribe to their feeds and read everything in one place.

Two major formats exist:

Feature RSS 2.0 Atom 1.0
Standardized No (frozen) Yes (RFC 4287 — IETF)
Date format RFC 822 RFC 3339 (ISO 8601)
Content types Limited Full MIME support
Namespaces Extension modules Core specification
Entries vs items <item> <entry>
Author support <managingEditor> <author> (required per entry)
Publication date <pubDate> <published>
Update tracking Not native <updated> (required)

RSS 2.0 Structure

RSS (Really Simple Syndication) 2.0 is the most widely deployed feed format. Despite not being a formal standard, its simplicity made it dominant.

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DodaTech Blog</title>
    <link>https://doda.tech</link>
    <description>Programming and security tutorials built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro</description>
    <language>en-us</language>
    <lastBuildDate>Fri, 19 Jun 2026 14:30:00 GMT</lastBuildDate>
    <pubDate>Fri, 19 Jun 2026 10:00:00 GMT</pubDate>
    <managingEditor>editor@doda.tech</managingEditor>
    <webMaster>admin@doda.tech</webMaster>
    <category>Technology</category>
    <generator>DodaTech Feed Generator 1.0</generator>
    <docs>https://www.rssboard.org/rss-specification</docs>
    <atom:link href="https://doda.tech/feed.xml" rel="self" type="application/rss+xml"/>
    <image>
      <url>https://doda.tech/logo.png</url>
      <title>DodaTech Blog</title>
      <link>https://doda.tech</link>
      <width>144</width>
      <height>144</height>
    </image>

    <item>
      <title>XML vs JSON vs YAML  Data Format Comparison</title>
      <link>https://doda.tech/xml/json-comparison/</link>
      <description>Compare XML, JSON, and YAML data formats: syntax, use cases, performance benchmarks, and security considerations.</description>
      <content:encoded><![CDATA[<p>Choosing the right data format impacts parsing speed, file size, and security. This guide compares all three...</p>]]></content:encoded>
      <author>author@doda.tech (DodaTech Team)</author>
      <category>XML</category>
      <category>Data Formats</category>
      <pubDate>Thu, 18 Jun 2026 08:00:00 GMT</pubDate>
      <guid isPermaLink="true">https://doda.tech/xml/json-comparison/</guid>
      <comments>https://doda.tech/xml/json-comparison/#comments</comments>
      <source url="https://doda.tech/feed.xml">DodaTech Blog</source>
    </item>

    <item>
      <title>Getting Started with Rust Programming</title>
      <link>https://doda.tech/programming-languages/rust/</link>
      <description>A beginner-friendly introduction to Rust: ownership, borrowing, and safe systems programming.</description>
      <author>author@doda.tech (DodaTech Team)</author>
      <category>Rust</category>
      <category>Programming</category>
      <pubDate>Wed, 17 Jun 2026 10:30:00 GMT</pubDate>
      <guid isPermaLink="true">https://doda.tech/programming-languages/rust/</guid>
    </item>
  </channel>
</rss>

RSS Required Elements

Element Description
<title> Name of the channel
<link> URL to the website
<description> Phrase or sentence describing the channel
<item> (at least one) A feed entry with its own <title> or <description>

RSS Common Optional Elements

Element Description
<language> Language of the channel (e.g., en-us)
<lastBuildDate> Last time content changed
<pubDate> Publication date for the item
<guid> Globally unique identifier for the item
<category> One or more categories for the item
<author> Email address of the item author
<enclosure> Enables podcasting (audio/video file metadata)
<source> Source channel for republished content

Atom 1.0 Structure

Atom was designed by the IETF to address RSS's limitations — primarily its lack of formal standardization and ambiguous date handling.

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
      xml:lang="en-US">
  <id>tag:doda.tech,2026:feed</id>
  <title>DodaTech Blog</title>
  <subtitle>Programming and security tutorials built by DodaTech</subtitle>
  <updated>2026-06-19T14:30:00Z</updated>
  <link rel="self" href="https://doda.tech/atom.xml" type="application/atom+xml"/>
  <link rel="alternate" href="https://doda.tech" type="text/html"/>
  <author>
    <name>DodaTech Team</name>
    <email>editor@doda.tech</email>
    <uri>https://doda.tech/about</uri>
  </author>
  <generator uri="https://doda.tech" version="1.0">DodaTech Atom Generator</generator>
  <icon>https://doda.tech/icon.png</icon>
  <logo>https://doda.tech/logo.png</logo>
  <rights>Copyright 2026 DodaTech. All rights reserved.</rights>

  <entry>
    <id>tag:doda.tech,2026:/xml/json-comparison/</id>
    <title>XML vs JSON vs YAML  Data Format Comparison</title>
    <updated>2026-06-18T08:00:00Z</updated>
    <published>2026-06-18T08:00:00Z</published>
    <link rel="alternate" href="https://doda.tech/xml/json-comparison/" type="text/html"/>
    <link rel="enclosure" href="https://doda.tech/podcasts/episode42.mp3" type="audio/mpeg" length="12345678"/>
    <summary type="html">Compare XML, JSON, and YAML data formats: syntax, use cases, performance benchmarks.</summary>
    <content type="html" xml:base="https://doda.tech">
      <![CDATA[<p>Choosing the right data format impacts parsing speed, file size, and security...</p>]]>
    </content>
    <category term="XML" scheme="http://doda.tech/categories"/>
    <category term="Data Formats"/>
    <contributor>
      <name>Alice Chen</name>
      <uri>https://doda.tech/authors/alice</uri>
    </contributor>
  </entry>

  <entry>
    <id>tag:doda.tech,2026:/programming-languages/rust/</id>
    <title>Getting Started with Rust Programming</title>
    <updated>2026-06-17T10:30:00Z</updated>
    <published>2026-06-17T10:30:00Z</published>
    <link rel="alternate" href="https://doda.tech/programming-languages/rust/" type="text/html"/>
    <summary>A beginner-friendly introduction to Rust: ownership, borrowing, and safe systems programming.</summary>
    <category term="Rust"/>
    <category term="Programming"/>
  </entry>
</feed>

Atom Required Elements

Element Description
<feed> Root element with xmlns="http://www.w3.org/2005/Atom"
<id> Permanent, globally unique identifier for the feed
<title> Human-readable name of the feed
<updated> Last update time (ISO 8601)
<author> or <entry> with <author> At least one author per feed
<entry> Individual feed item with <id>, <title>, and <updated>

Generating a Feed with Python

import xml.etree.ElementTree as ET
from datetime import datetime, timezone

def create_rss_feed(items):
    rss = ET.Element("rss", version="2.0")
    channel = ET.SubElement(rss, "channel")

    ET.SubElement(channel, "title").text = "DodaTech Blog"
    ET.SubElement(channel, "link").text = "https://doda.tech"
    ET.SubElement(channel, "description").text = "Programming tutorials"
    ET.SubElement(channel, "language").text = "en-us"
    ET.SubElement(channel, "lastBuildDate").text = datetime.now(
        timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")

    for title, link, desc, date in items:
        item = ET.SubElement(channel, "item")
        ET.SubElement(item, "title").text = title
        ET.SubElement(item, "link").text = link
        ET.SubElement(item, "description").text = desc
        ET.SubElement(item, "pubDate").text = date
        guid = ET.SubElement(item, "guid")
        guid.text = link
        guid.set("isPermaLink", "true")

    return ET.tostring(rss, encoding="unicode", xml_declaration=True)

# Sample data
feed_items = [
    ("XML vs JSON vs YAML", "https://doda.tech/xml/json-comparison/",
     "Compare data formats.", "Thu, 18 Jun 2026 08:00:00 GMT"),
    ("Rust Guide", "https://doda.tech/programming-languages/rust/",
     "Rust programming basics.", "Wed, 17 Jun 2026 10:30:00 GMT"),
]

print(create_rss_feed(feed_items))

Expected output (truncated):

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>DodaTech Blog</title>
    <link>https://doda.tech</link>
    <description>Programming tutorials</description>
    <language>en-us</language>
    <lastBuildDate>Sat, 20 Jun 2026 10:00:00 GMT</lastBuildDate>
    <item>
      <title>XML vs JSON vs YAML</title>
      <link>https://doda.tech/xml/json-comparison/</link>
      <description>Compare data formats.</description>
      <pubDate>Thu, 18 Jun 2026 08:00:00 GMT</pubDate>
      <guid isPermaLink="true">https://doda.tech/xml/json-comparison/</guid>
    </item>
    <item>
      <title>Rust Guide</title>
      <link>https://doda.tech/programming-languages/rust/</link>
      <description>Rust programming basics.</description>
      <pubDate>Wed, 17 Jun 2026 10:30:00 GMT</pubDate>
      <guid isPermaLink="true">https://doda.tech/programming-languages/rust/</guid>
    </item>
  </channel>
</rss>

Parsing a Feed

import xml.etree.ElementTree as ET
import urllib.request

def parse_rss_feed(url):
    response = urllib.request.urlopen(url)
    tree = ET.parse(response)
    root = tree.getroot()

    channel = root.find("channel")
    print(f"Feed: {channel.find('title').text}")
    print(f"Latest: {channel.find('lastBuildDate').text}\n")

    for item in channel.findall("item"):
        title = item.find("title").text
        link = item.find("link").text
        pub_date = item.find("pubDate").text
        print(f"  {pub_date}")
        print(f"  {title}")
        print(f"  {link}\n")

parse_rss_feed("https://doda.tech/feed.xml")

Expected output:

Feed: DodaTech Blog
Latest: Fri, 19 Jun 2026 14:30:00 GMT

  Thu, 18 Jun 2026 08:00:00 GMT
  XML vs JSON vs YAML — Data Format Comparison
  https://doda.tech/xml/json-comparison/

  Wed, 17 Jun 2026 10:30:00 GMT
  Getting Started with Rust Programming
  https://doda.tech/programming-languages/rust/

Podcasting with RSS Enclosures

The <enclosure> element turned RSS into the distribution backbone of the podcast industry. Apple Podcasts, Spotify, and every podcast client parse this element to find audio or video files.

<item>
  <title>Episode 42: XML Security Deep Dive</title>
  <link>https://doda.tech/podcasts/episode42</link>
  <description>Exploring XXE attacks, XML bombs, and secure parsing techniques.</description>
  <enclosure url="https://doda.tech/podcasts/episode42.mp3"
             length="12345678"
             type="audio/mpeg"/>
  <pubDate>Fri, 19 Jun 2026 06:00:00 GMT</pubDate>
  <guid>https://doda.tech/podcasts/episode42</guid>
  <itunes:duration xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">45:30</itunes:duration>
  <itunes:summary>Learn how to secure your XML parsers against XXE and billion laughs attacks.</itunes:summary>
</item>

The <enclosure> attributes:

  • url: Direct link to the media file (must be accessible via HTTP)
  • length: File size in bytes (required by RSS spec)
  • type: MIME type (audio/mpeg, video/mp4, audio/ogg)

Common Mistakes

1. Missing or invalid GUID

Every RSS item needs a unique <guid>. Using the same GUID for multiple items causes feed readers to show duplicate content.

2. Incorrect date format

RSS requires RFC 822 dates: Fri, 19 Jun 2026 14:30:00 GMT. Atom requires ISO 8601: 2026-06-19T14:30:00Z. Mixing them breaks validation.

3. Not escaping HTML in descriptions

<description>Use <b>bold</b> text</description>

Use CDATA or escape HTML entities:

<description><![CDATA[Use <b>bold</b> text]]></description>

Without <link rel="self" href="..."/>, feed readers may not discover the feed URL for subscription purposes.

5. Oversized feeds

Including full article content for 50+ items results in multi-megabyte feeds. Use <summary> for excerpts and link to full content.

6. Ignoring encoding declarations

Always specify encoding="UTF-8" in the XML declaration. Non-ASCII characters like em dashes or accented letters will break otherwise.

7. Not handling feed redirects

When migrating domains, use HTTP 301 redirects on feed URLs. Feed readers handle permanent redirects, but changing URLs without notification loses subscribers.

Security Considerations

Feed processing is a common attack vector. Durga Antivirus Pro scans incoming RSS/Atom feeds for:

  • XXE injection: Malicious entities that read local files or perform SSRF
  • XML bombs: Entity expansion attacks causing denial of service
  • Phishing links: Feeds containing malicious URLs disguised as legitimate content
  • JavaScript injection via CDATA: Though feeds are XML, content displayed via web-based readers can execute scripts

Always use secure XML parsing libraries and validate feed content before processing:

# Secure parsing — disable DTD processing
from defusedxml import ElementTree as ET
tree = ET.parse("feed.xml")  # Automatically blocks XXE

Practice Questions

  1. What are the three required elements in an RSS <item>? At least <title> or <description> must be present. <link> and <guid> are strongly recommended but not strictly required.

  2. What is the difference between RSS <pubDate> and Atom <updated>? <pubDate> in RSS is the initial publication date (RFC 822). <updated> in Atom is the last modification time (ISO 8601) and is required for every entry.

  3. How do podcasts use RSS? The <enclosure> element provides the media file URL, size, and MIME type. Podcast clients parse this to build episode lists and download audio files.

  4. What does <guid isPermaLink="true"> mean? The GUID is a permanent URL that can be used as the item's web page address. If isPermaLink is false, the GUID is just a unique identifier string.

  5. Why should you use CDATA in RSS descriptions? CDATA sections allow HTML markup inside XML without escaping every < and > character, keeping the feed content valid XML.

Challenge: Build a podcast feed generator that reads episode metadata from a JSON file (title, description, audio URL, duration, publication date) and outputs a valid RSS 2.0 feed with iTunes namespace extensions for podcasting.

Real-world task: DodaZIP archives web content for offline access. Write a feed aggregator that downloads RSS feeds, validates them against the RSS 2.0 spec, extracts new items, and archives them as XML files with metadata.

FAQ

What is the difference between RSS and Atom?

RSS 2.0 is simpler and more widely deployed, especially for podcasting. Atom is an IETF standard (RFC 4287) with stricter requirements like mandatory author per entry, ISO 8601 dates, and better internationalization support. Both use XML.

How do I validate my RSS feed?

Use the W3C Feed Validation Service (https://validator.w3.org/feed/) or run xmllint --noout feed.xml to check well-formedness. The RSS Board also provides a validator at https://www.rssboard.org/rss-validator/.

Can RSS and Atom be used for private feeds?

Yes. Serve feeds behind authentication (HTTP Basic Auth or token-based) and use HTTPS. Many feed readers support authenticated subscriptions.

What's Next

Tutorial What You'll Learn
SVG as XML — Scalable Vector Graphics Guide Create vector graphics using XML syntax
XML Configuration Files — Complete Guide Manage application settings with XML configs
XML Web Services — SOAP & REST with XML Build enterprise web services with XML messaging

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Updated 2026-06-20.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro