If you want to return only values, you can use XPath //text()|@* .
If you want attribute and element names along with values, you can use this stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:strip-space elements="*"/> <xsl:template match="*"> <xsl:apply-templates select="node()|@*"/> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="concat('<',name(parent::*),'> ',.,'
')"/> </xsl:template> <xsl:template match="@*"> <xsl:value-of select="concat(name(),'="',.,'"
')"/> </xsl:template> </xsl:stylesheet>
With your input, it will produce this output:
bar="a" bee="localhost" Id="1" Rt="00:00:03" Name="hello" <step> Pass
source share