Idle pondering from a Scala learner perhaps, but ... in my tinkerings I\'ve written the following:
( n.child.size > 0 ) && ( n.child.filter( ! _.isIns
class Tap[A](underlying:A){ def tap[B](func: A=>B) = func(underlying) } implicit def anyToTap[A](underlying:A)=new Tap(underlying) n.child.tap{x => ( x.size > 0 ) && ( x.filter( ! _.isInstanceOf[Text] ).size == 0 ) }