white foam on mature oak tree trunk
This looks like slime flux. It is possible there may have been some bark cracks or an old wound where the foam/sap is coming from. There is no treatment that will cure this. There is more information about slime flux on the following page of our website. https://extension.umd.edu/hgic/slime-flux-and-wetwood-trees-and-shrubs
Unless the tree is in decline monitor the tree for symptoms and keep your tree as healthy as possible by watering during dry periods and make sure mulch is no thicker than several inches and keep away from the trunk. Prune dead wood.