<?xml version="1.0" encoding="UTF-8"?>
<?xmlspysamplexml e:\cio\projekte\erecht\beispiele\xmlDokument.xml?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:inst="urn:instance">
  <xsl:output encoding="UTF-8" method="xml" indent="yes"/>
  <xsl:template match="/inst:XMLDarstellung">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>HTML-Darstellung</title>
      </head>
      <body>
        <p>
          <xsl:for-each select="child::node()">
            <xsl:choose>
              <xsl:when test="./self::text()">
                <xsl:value-of select="."/>
              </xsl:when>
              <xsl:when test="./self::inst:Bild">
                <img>
                  <xsl:attribute name="src"><xsl:value-of select="./@Reference"/></xsl:attribute>
                  <xsl:attribute name="alt">alternative text</xsl:attribute>
                </img>
              </xsl:when>
            </xsl:choose>
          </xsl:for-each>
        </p>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>