validation MAINTENANCE use function instead of special code
diff --git a/src/validation.c b/src/validation.c
index 33eef1c..3ee25f7 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -1188,9 +1188,7 @@
 
     /* find first top-level node */
     for (tree = node; tree->parent; tree = lyd_parent(tree)) {}
-    while (tree->prev->next) {
-        tree = tree->prev;
-    }
+    tree = lyd_first_sibling(tree);
 
     LY_ARRAY_FOR(musts, u) {
         memset(&xp_set, 0, sizeof xp_set);