You can use XSLT, it is not limited to generating only XML output. is helimited to XML input. Use the xsl: output tag to determine the type of output you will generate.
eg. to generate text output
<xsl:output method="text" encoding="UTF-8"/>
To generate indented XML output
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
source
share