Trying something kind of wacky in cleaning up some verbose XML, which is to remove all empty nodes recursively.
For this purpose, I consider a node to be "empty" if it has (a) no child nodes, (b) whitespace-only content, (c) only "empty" child nodes. That is, I consider the following to be "empty" because all of the leaves are empty/whitespace-only nodes:
<foo>
<bar>
<baz/>
</bar>
<quux> </quux>
</foo>
I tried using <xsl:if test="child::node()">
in my templates, but that didn't seem to work. It's entirely possible the answer is "walk the tree yourself, silly", but it seems like the sort of thing XSL should be able to do?
I would expect
<foo>
<bar>
<baz/>
</bar>
<quux> </quux>
<quuux>Actual content</quuux>
</foo>
to come back as
<foo>
<quuux>Actual content</quuux>
</foo>
with this filter I have in mind.