It isn't difficult to produce such tool yourself:
Add to any template that matches element(s) or attribute(s):
<xsl:message>
<!-- Put all the data here that identifies the element attribute,
for example the Xpath expression that selects the current node
-->
</xsl:message>
You can use existing transformations that take a node and produce one XPath expression that selects the node -- invoke them inside the above xsl:message
. See for example this: Generate/get xpath from XML node java
Then what you need to do is to combine all these generated XPath expressions with the |
operator and to evaluate the resulting XPath expression -- this will select all elements and attributes that are actually referenced in the transformation.
If you also want to account for the elements/attributes that are processed by the XSLT built-in templates, simply override those with specific templates in your transformation -- this is a good practice that as additional benefit may find errors in your transformation.