Best way to start writing an XSLT

I am frequently asked where to start when writing an XSL?. 

I always start by writing a simple identity transform:

<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template match="node(  ) | @">
    <xsl:apply-templates select="@
| node(  )"/>

(quoted from “XSLT Cookbook” by Sal Mangano).

This simple stylesheet will do nothing but copy the input XML file element by element, attribute by attribute. You can customize it from here. An empty <xsl:template match=”node( ) | @*”> will “swallow” every node and attribute and can be used to get rid of the “dangling text nodes” problem a lot of my colleagues complain about.