Is it possible to check the type of a node I matched with a template inside the same template? In case it is, how can I do it? For example I would like to do something like
I highly recommend you to use the expressions on sequence types introduced in XPath 2.0. For example:
. instance of document-node() . instance of element()