<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                <xsl:output method="html"/>
                <xsl:template match="message">
                        <div>
                                <xsl:attribute name="style">
                                        <xsl:if test="@type='action'">
                                                font-weight:bold;
                                        </xsl:if>
                                        <xsl:choose>
                                                <xsl:when test="@route='inbound'">
                                                        background-color:red;
                                                </xsl:when>
                                                <xsl:when test="@route='outbound'">
                                                        background-color:blue;
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        background-color:black;
                                                </xsl:otherwise>
                                        </xsl:choose>
                                        color:white;
                                </xsl:attribute>
                                <span>
                                        <xsl:attribute name="style">
                                                color:<xsl:value-of select="from/contact/@color"/>
                                        </xsl:attribute>
                                        Message from: <xsl:value-of select="from/contact/@contactDisplayName/@text"/>
                                </span>
                                &#160;
                                <span>
                                        <xsl:value-of select="body"/>
                                </span>
                        </div>
                </xsl:template>
</xsl:stylesheet>