boolean result = true;
HashSet <String> rootPaths = new HashSet<String>();
for (ElementNode node: filter) {
// Step 1: Check if the element exists in the hierarchy.
Element el = hier.getElementById(node.getElement().getId());
if (el != null) {
// Step 2: Check if the path matches the element in the structure.
String path;
String localPath = getPath(node);
if (allPaths == null || pathCounter >= allPaths.length) {