Output the name of an element or attribute using one of name() or local-name():
Assume this document:
Then this stylesheet:
Produces:
apple
banana
sugar
cat
color
color
taste
size
Notice that both elements and attributes are handled by the same template.