It should be possible to collapse nested empty elements with a custom filter function

Fix for #10