How to get the IElement of a IEntityInstance?

I have a IEntityInstance at hand and would like to get the IElement instance of the corresponding model of it. Does A12 provide any utility that I can use for this? I haven’t had any success in finding anything.

Moin,
you could create an instance of IDocumentModelSearchService from Kernel via DocumentModelServiceFactory and use the getByPath-method, which takes a path (from IEntityInstance) and returns an optional of IElement.

I’ve checked for 2022.02 and 2022.06 version of A12.

Solution above also works for 2021.06