So I assume, currently there's no way to construct this kind of filters without the use of externally defined function.
Too bad, I was hoping that there is some kind of special syntax for that.
External function by itself is not a very bad idea (for now I have used pretty similar approach). The problem is that I have to define this function in every scripted action where I process e4x objects with filters. Looks like there's another candidate to "utils" action module.
Or maybe there's a way to make this function globally visible?