Simplify iteration over immediate siblings

Depends-on: https://gerrit.cesnet.cz/c/CzechLight/libyang-cpp/+/5831
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/5842
Change-Id: I813e0db67b855544aeba6d7894263e1d808f9662
diff --git a/src/netconf_access.cpp b/src/netconf_access.cpp
index 8fc3e55..6634dc6 100644
--- a/src/netconf_access.cpp
+++ b/src/netconf_access.cpp
@@ -249,7 +249,7 @@
     for (const auto& instance : instances->findXPath(path)) {
         ListInstance instanceRes;
 
-        for (const auto& keyLeaf : instance.child()->siblings()) {
+        for (const auto& keyLeaf : instance.immediateChildren()) {
             // FIXME: even though we specified we only want the key leafs, Netopeer disregards that and sends more data,
             // even lists and other stuff. We only want keys, so filter out non-leafs and non-keys
             // https://github.com/CESNET/netopeer2/issues/825
diff --git a/src/yang_access.cpp b/src/yang_access.cpp
index 6c18779..8407a4d 100644
--- a/src/yang_access.cpp
+++ b/src/yang_access.cpp
@@ -241,7 +241,7 @@
     auto instances = m_datastore->findXPath(path);
     for (const auto& list : instances) {
         ListInstance instance;
-        for (const auto& child : list.child()->siblings()) {
+        for (const auto& child : list.immediateChildren()) {
             if (child.schema().nodeType() == libyang::NodeType::Leaf) {
                 auto leafSchema(child.schema().asLeaf());
                 if (leafSchema.isKey()) {