Layered materials with alpha channel

How to mix let’s say two material funcions with alpha node ( to plug transparent mask texture)
I would like to achieve something like MatLayerBlend_AO node.