Merhaba arkadaşlar

Wordpress sitemde eklenen son 10 konuyu rss.xml olarak yazdırmak istiyorum ama bir türlü başarılı olamadım.

<?xml version=\"1.0\" encoding=\"UTF-8"?><?php

$xml = new SimpleXMLElement("<rss xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:taxo=\"http://purl.org/rss/1.0/modules/taxonomy/\" version=\"2.0\">"?>
<channel>
    <title>Site Başlığı</title>
    <link>http://www.site.com/</link>
    <description>Site Açıklaması</description>
    <language>tr</language>
 <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
    <image>
      <title>Site Başlığı</title>
      <url>http://www.site.com/logo.png</url>
      <link>http://www.site.com/</link>
    </image><?php endwhile; ?>

<item>
      <title><?php the_title(); ?></title>
      <link><?php the_permalink(); ?></link>
      <guid><?php the_permalink(); ?></guid>
      <comments><?php the_permalink(); ?>#comment</comments>
	  <description><![CDATA[<a target="_blank" href="<?php echo get_site_url(); ?>">
	  <IMG src="<?php echo "RESIM" ;?>" border="0" align="left" width="120" height="90"/>
</a>YAZI ÖZETİ]]></description>
	  <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
    </item> <?php echo $xml->asXML();?></channel>
</rss>

nasıl php yi xml olarak çıkartabilirim.. yardımlarınızı bekliyorum