<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="<?php bloginfo_rss('home') ?>/wp-atom.php">
	<title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>

	<updated></updated>
	<generator></generator>
	<link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>"/>
	<id><?php bloginfo_rss('url'); ?>/playlist/<?php echo md5(array_values($attachments)); ?></id>
	<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>"/>
<?php if ($attachments) : foreach ($attachments as $attachment) : ?>
	<entry>
		<title type="text"><?php echo Playlist_Maker::xmlspecialchars($attachment->post_title); ?></title>
		<id><?php echo Playlist_Maker::xmlspecialchars($attachment->guid); ?></id>
		<content type="<?php echo $attachment->post_mime_type; ?>" src="<?php echo wp_get_attachment_url($attachment->ID); ?>"/>
		<link rel="alternate" type="text/html" href="<?php echo get_permalink($attachment->ID); ?>"/>
		<updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
	</entry>
<?php endforeach; else: ?>
	<!-- No tracks -->
<?php endif; ?>
</feed>