thanks a lot for the code and the comments,
by the way
Any attempt to create a proper template has encountered some xsl
limitation :
impossibility to open and close an element in two separate templates
impossibility to change variable values at runtime.
Neither of those things is an XSLT limitation.
The first is a basic rule of XML, nothing specific about XSLT, element
structure has to be well formed, ie properly nested.
The second is just a feature of declarative programming languages, but
these are computationaly equivalent to imperative programming languages,
so this is not, itself, a limitation.
I know those are features, and not limitations, I was using an approach
not siuted for this language.
bye