<xsl:output method=”xml” indent=”yes”/>
Saying indent=”yes” in xsl:output allows the processor to indent the output any way it chooses. If you don’t want that, don’t specify indent=”yes”; you will then get no extra whitespace in the output unless you create it explicitly using <xsl:value-of> or <xsl:text>.
If you want more intelligent formatting, you can use Saxon in schema-aware mode, validating the output against a schema. It will then avoid applying indentation to elements that are defined in the schema to have a mixed content model, which seems to be the effect you are looking for here.
———————————————–
<xsl:text>
</xsl:text>
</xsl:variable>
usage:
<xsl:value-of select=”$newline”> <!– line break in output file –>
———————————————–
http://www.ibm.com/developerworks/xml/library/x-tipwhitesp.html
<faqoutput><xsl:text>
</xsl:text><info xml:space=”preserve”>
<title xml:space=”default”>
<xsl:value-of select=”faqs/question/questiontitle”/>
</title>
</info>
<xsl:apply-templates/>
</faqoutput>
</xsl:template>
————————————————
<xsl:text>
</xsl:text>
————————————————
And if you use <xsl:if test=…>, you can send your literal
output based on an arbitrary condition.