Select few types by withType

Is it possible to select few types by withType ? I mean something like that:

binaries.withType(X, Y) { binary ->

}

binaries.all { binary ->
   if ([X, Y].find { it.isInstance(binary) }) {
     ... 
   } 
}