Using in-memory XML OSM Java object instead of OSM from file path

This is currently not possible. There was a community member who shared some code some years ago: