Input XML: <?xml version="1.0" encoding="UTF-8"?> <sandwich price="2.00"> <meat>Pastrami</meat> <bread>Rye</bread> <cheese slices="1">Swiss</cheese> </sandwich> XSLT: <!-- XSLT is itself XML --> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/sandwich"> <!-- the HTML tags are embedded directly in the template --> <html> <head><title>My Sandwich</title></head> <body> <!-- when executed, the value-of element is replaced with the actual value --> <b>Meat:</b> <xsl:value-of select="meat" /><br /> <b>Bread:</b> <xsl:value-of select="bread" /><br /> <b>Cheese:</b> <xsl:value-of select="cheese/@slices" /> slice(s) of <xsl:value-of select="cheese" /> <br /><br /> <b>Cost:<xsl:value-of select="@price" /></b> </body> </html> </xsl:template> </xsl:stylesheet> Output: <html> <head> <title>My Sandwich</title> </head> <body> <b>Meat:</b>Pastrami<br /> <b>Bread:</b>Rye<br /> <b>Cheese:</b>1 slice(s) of Swiss <br /><br /> <b>Cost: 2.00</b> </body> </html>