Is it possible to write xpath expressions that will query a web server's web.xml like this one :

 <display-name>My Application</display-name>
  <!-- Standard Action Servlet Configuration (with debugging) -->

  <!-- Standard Action Servlet Mapping -->


I would want to know if a particular web.xml has certain set of tags present or not. Like <servlet> and </servlet>
And if yes to get their count.
How can this be achieved using XPath expressions?


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
  <xsl:param name="find">servlet</xsl:param>

  <xsl:output method="text" encoding="utf-8"/>

  <xsl:template match="node()">
    <xsl:value-of select="count(//*[local-name()=$find])"/>