<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:atom="http://www.w3.org/2005/Atom" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wp="http://wordpress.org/export/1.0/"
  version="1.0">

<xsl:template name="atom:title">
  <xsl:copy>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="atom:content">
  <content:encoded>
    <xsl:apply-templates/>
  </content:encoded>
</xsl:template>

<xsl:template match="atom:published">
  <wp:post_date>
    <xsl:apply-templates/>
  </wp:post_date>
</xsl:template>

<xsl:template match="atom:category">
  <xsl:variable name="currlabel" select="@label"/>
   <xsl:if test="string-length($currlabel)">
    <category>
     <xsl:value-of select="@label"/>
    </category>
   </xsl:if>
</xsl:template>


<xsl:template match="atom:feed">
    <xsl:for-each select="atom:entry">
 	 <item>
       <title>
          <xsl:apply-templates select="atom:title"/>
        </title>
       <xsl:apply-templates select="atom:published"/>
      <dc:creator>thorstenb</dc:creator>
      <wp:status>publish</wp:status>

      <xsl:apply-templates select="atom:category"/>

      <xsl:apply-templates select="atom:content"/>

	 </item>
    </xsl:for-each>
</xsl:template>

<xsl:template match="/">
 <rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:wp="http://wordpress.org/export/1.0/"
 >
   <channel>
	<title>Thorsten's Weblog</title>
	<link>http://thorstenb.wordpress.com</link>
	<description>In the trenches with OpenOffice.org's graphic subsystems</description>
	<language>en</language>
	<wp:category>
      <wp:category_nicename>uncategorized</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name>
    </wp:category>
	<wp:category>
      <wp:category_nicename>personal</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Personal]]></wp:cat_name>
    </wp:category>
	<wp:category>
      <wp:category_nicename>openoffice.org</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[OpenOffice.org]]></wp:cat_name>
    </wp:category>
    <xsl:apply-templates/>
   </channel>
  </rss>
</xsl:template>

<xsl:output 
  method="xml" 
  indent="yes"
  cdata-section-elements="content:encoded category"/>

</xsl:stylesheet>