You can apply a constraint on the objects, while choosing the Datasource as XPath,
You can refer to the image below,
Or, the other way is to, use a microflow as the data source and then using List operations, you can easily filter out the objects which are empty and the show the list as per your choice,
Let me know, if you have any issues,
Hope it helps!!
Did you tried to use conditional visibility?
You should be able to set the condition to the emptyness of the list.
It seems that $currentobject is carrying the relationship to the list. If the condition is on $currentobject != empty and the list is empty, you will still see it.
I don't think that you can set in visibility a condition such as $currenobject/listed_object != empty.
I suppose you can add a calculated boolean flag to $currentobject that is false if the related list is empty and set the visibility condition to the flag is true.