I have following XML input:
<my_value>test123</my_value>
Here is XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:err="http://www.w3.org/2005/xqt-errors" exclude-result-prefixes="array fn map math xhtml xs err" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="*">
<xsl:element name="my_node">
<xsl:namespace name="tns" select="'http://www.example.com'"/>
<xsl:element name="my_child">
<xsl:value-of select="my_value"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
As an output I want to have:
<tns:my_node xmlns:tns="http://www.example.com">
<tns:my_child>test123</tns:my_child>
</tns:my_node>
How to modify XSL to achieve my goal?