I've a scenario, when I need to uncomment the SSL configuration from server.xml (tomcat) and also need to add a couple of attributes in it. I succeeded adding two attributes when there is SSL configuration already available but my template doesn't work for the just uncommented part. Any idea?\[code\]<?xml version='1.0' encoding='utf-8'?><?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/15509574/new2.xsl"?><Server port="8005" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --> <Listener className="org.apache.catalina.core.JasperListener" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!--NEED TO UNCOMMENT AND ADD ATTRIBUTES IN THE FOLLOWING ELEMENT--> <!--<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> </Host> </Engine> </Service></Server>\[/code\]The xslt is following which uncomments the part and if the part is already uncommented, adds the two attributes in it.\[code\]<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xslutput method="xml" indent="yes"/> <xsl:template match="@* | node()" name="Copy"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="@* | node()" mode="insertConnector"> <xsl:call-template name="Copy" /> </xsl:template><!--If the SSL configuration doesn't exist but availabe in comments, uncomment it--> <xsl:template match="comment()[not(../Connector[@scheme = 'https']) and contains(., 'Connector') and (contains(., 'scheme=https') or contains(., scheme='https'))]"> <xsl:value-of select="." disable-output-escaping="yes"/> <!--This line uncomments the comment--> </xsl:template> <xsl:template match = "Connector[@scheme = 'https']" name="AddAttributes"> <Connector keystoreFile="${user.home}/.keystore"> <xsl:apply-templates select="@* | node()"/> </Connector> </xsl:template></xsl:stylesheet>\[/code\]Please guide me how can I add the attributes in commented part or add the attributes in the element right after uncommenting it. Above XSLT is only uncommenting the SSL configuration part. Thank you.