Indeed, it seems the only solution is to define it as a root. Is that a problem?
This code works:
DATA xml_string TYPE string.
CALL TRANSFORMATION ztestSOURCE var_xmlns = 'urn:test'RESULT XML xml_string.
The transformation :
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="VAR_XMLNS"/>
<tt:template>
<Jetstream>
<tt:attribute name="xmlns" value-ref="VAR_XMLNS"/>
value
</Jetsream>
</tt:template>
</tt:transform>The result (in xml_string) :
<?xml version="1.0" encoding="utf-16"?>
<Jetstream xmlns="urn:test">## value## </Jetstream>