I am searching for a xslt stylesheet which simply outputs (at the console
or into a file) all matching nodes (including their individual attributes)
for a given XPath expression and a given (valid) xml document.
Instead of the hardcoded XPath expression you could use a global parameter that you can set from a command line; and you can of course customize the way the node is rendered in <xsl:template match="*"> (maybe including only the name and the attributes, but not the children element...).