Do developers have to put certain/extra elements in the feed’s XML file or attributes in the hyperlink for the browser to recognize that it’s a feed that can be subscribed to? Or do browsers do that automatically as long as the XML validates?
(showing users that ‘Subscribe to this feed using…’ interface in Firefox or ‘You are viewing a feed that contains frequently updated content. When you subscribe to a feed, …’ interface on Internet Explorer, etc.)
Most modern browsers are intelligent enough to inspect an XML data source and HTTP headers and determine if it represents a syndication feed (typically formatted as Atom or RSS). However, there are a couple of things you can do to improve auto-discovery of syndication feeds within a web site and when dynamically generating syndication feeds:
Auto-discovery of syndication feed(s) provided by a web site
The established way to provide feed auto-discovery for web browsers is through the use of the link element with a rel attribute value of alternate within the head of the web page. You should also specify the MIME type of the feed using the type attribute of the link, and may specify the name of the feed using the title attribute. Most browsers will support the discovery of multiple feeds (e.g. when you provide the same syndicated content in multiple formats).
Example:
Explicitly indicate the HTTP MIME type of syndicated content
If you are dynamically generating your syndicated content, it is a good practice to explictly indicate the MIME content type. For Atom feeds, the offical registered MIME type is application/atom+xml. While there is actually no offically registered MIME type for RSS feeds, the defacto that is used is application/rss+xml.