Element
The easiest and most common way to generate element is literal result element. An element that is declared directly in the xslt file without any prefix. But sometimes you want to put it in a <xsl:element> node. Sometimes you want to use attribute value template within the name of the element. You can put curly brackets {} in the name attribute of xsl:element node.
So xsl:element is rarely used unless you are translating to xml document.
The name
attribute is required
Namespace
Namespace can be declared in the xsl:stylesheet element. Namespace declared in the xsl:stylesheet will be appear in the result document.
exclude-result-prefixes attribute can be used to exclude the namespace declaration in the stylesheet.
The default element in xsl:stylesheet is also the default element of the output file.
You can include a namespace in the xsl:element name attribute
So math prefix is used to decorate the <matrix> element
<xsl:element name="math:matrix">
...
</xsl:element>
<xsl:namespace>
has a name attribute to hold the prefix and a select attribute or content to hold the namespace
Attribute
<xsl:attribute>use
select attribute to select the value for the attribute.
use content to hold the text
<xsl:attribute-set>defines a set of attributes
<xsl:attribute-set>
<xsl:attribute name="attr1">value1</xsl:attribute>
<xsl:attribute name="attr2">value2</xsl:attribute>
</xsl:attribute-set>
To use attribute sets, specify a use-attribute-sets attribute on <xsl:element>, <xsl:copy>, or <xsl:attribute-set> elements.
Attribute sets can also be used by specifying an
xsl:use-attribute-sets attribute on a literal result element.
Document
xsl:result-document> creates a result document with
href attribute as its file name
format attribute is optional