Hey Sammy i guess you could write a script for that i guess something like this should work:
private List<StoreElement> getChildElementsWithoutReferences(StoreElement rootElement) {
List<StoreElement> allElements = new ArrayList<>();
Listable<StoreElement> childElements = rootElement.getChildren();
if (childElements.toList().size() > 0) {
for (StoreElement element : childElements) {
allElements.addAll(getChildElementsWithoutReferences(element));
}
} else {
ReferenceEntry[] incomingReferences = rootElement.getIncomingReferences();
if (incomingReferences.length == 0) {
allElements.add(rootElement);
}
}
return allElements;
}