XSLT example:
<?xml version="1.0"?>
<!-- This stylesheet generates a hard disconnect port configlet -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:import href="variables.xsl"/><xsl:output indent="yes"/><xsl:strip-space elements="*"/>
<!-- Main body. First generate the header, then the controller section, then the WAN ACL section, then the interface section.-->
<xsl:template match="configlet"><configlet><interface><xsl:value-of select="$interfacename"/></interface><xsl:call-template name="header"><xsl:with-param name="type">CDSC</xsl:with-param></xsl:call-template><xsl:call-template name="sdisc_interface"/><statement>no shutdown</statement><statement>exit</statement><statement>end</statement><xsl:call-template name="cdisc_verify"/><statement>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</statement></configlet></xsl:template>
<!-- Template that generates all the sections -->
<xsl:include href="header.xsl"/><xsl:include href="sdisc_interface.xsl"/><xsl:include href="cdisc_verify.xsl"/></xsl:stylesheet>
XML Transformation Java Example using XSLT Processor from apache API: