<?xml version="1.0" encoding="utf-8"?>
<detail id="1243">
<nazev>Praktický lékař pro dospělé</nazev>
<jmeno>MUDr. Nomen Omen</jmeno>
<adresa>Street 1/234, 18000 City 8</adresa>
<telefon>89879076</telefon>
<fax/>
<ico>8908078</ico>
<poradove-cislo>000</poradove-cislo>
<poradove-cislo-det-prac>000</poradove-cislo-det-prac>
<nazev-zrizovatele>Fyzická osoba</nazev-zrizovatele>
<druh-zz>320 Samost.ordinace prakt.lék.pro dospělé</druh-zz>
<email>nomen-omen@mailer.ru</email>
<www/>
</detail>
XSLT template file - takes one parametr output-header - when true, header is output first, output is Tab separated, no escaping nor quoting is done
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:param name="output-header" value="false"/>
<xsl:template match="/">
<xsl:if test="$output-header='true'">
<xsl:value-of select="concat('id','	')"/>
<xsl:value-of select="concat('type','	')"/>
<xsl:value-of select="concat('nazev','	')"/>
<xsl:value-of select="concat('jmeno','	')"/>
<xsl:value-of select="concat('adresa','	')"/>
<xsl:value-of select="concat('telefon','	')"/>
<xsl:value-of select="concat('fax','	')"/>
<xsl:value-of select="concat('ico','	')"/>
<xsl:value-of select="concat('poradove-cislo','	')"/>
<xsl:value-of select="concat('poradove-cislo-det-prac','	')"/>
<xsl:value-of select="concat('nazev-zrizovatele','	')"/>
<xsl:value-of select="concat('druh-zz','	')"/>
<xsl:value-of select="concat('email','	')"/>
<xsl:value-of select="concat('www','')"/>
<xsl:text>
</xsl:text>
</xsl:if>
<xsl:for-each select="//detail">
<xsl:value-of select="concat(@id,'	')"/>
<xsl:value-of select="concat('detail','	')"/>
<xsl:value-of select="concat(nazev,'	')"/>
<xsl:value-of select="concat(jmeno,'	')"/>
<xsl:value-of select="concat(adresa,'	')"/>
<xsl:value-of select="concat(telefon,'	')"/>
<xsl:value-of select="concat(fax,'	')"/>
<xsl:value-of select="concat(ico,'	')"/>
<xsl:value-of select="concat(poradove-cislo,'	')"/>
<xsl:value-of select="concat(poradove-cislo-det-prac,'	')"/>
<xsl:value-of select="concat(nazev-zrizovatele,'	')"/>
<xsl:value-of select="concat(druh-zz,'	')"/>
<xsl:value-of select="concat(email,'	')"/>
<xsl:value-of select="concat(www,'')"/>
<xsl:text>
</xsl:text>
</xsl:for-each></xsl:template>
</xsl:stylesheet>
Customization: use your own element names, template matching rule and whatever to process more complex XMLs. Keep the structure (spaces, line ends) of the tailing <xsl:text> to get proper line ends at the right places.