<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text" media-type="text/javascript" encoding="UTF-8"/>

<xsl:template match="/">
var msnSearchResponse = {
  <xsl:apply-templates select="rss/channel"/>
};
</xsl:template>

<xsl:template match="channel">
  "title": "<xsl:value-of select="title"/>",
  "link": "<xsl:value-of select="link"/>",
  "description": "<xsl:value-of select="description"/>",
  "items": [
    <xsl:apply-templates select="item"/>
    {
      "title": "dummy",
      "link": "dummy",
      "description": "dummy"
    }
  ]
</xsl:template>

<xsl:template match="item">
    {
      "title": "<xsl:value-of select="title"/>",
      "link": "<xsl:value-of select="link"/>",
      "description": "<xsl:value-of select="description"/>"
    },
</xsl:template>

</xsl:stylesheet>
