diff --git a/src/utils/libyang.cpp b/src/utils/libyang.cpp
index a4b7479..d58822c 100644
--- a/src/utils/libyang.cpp
+++ b/src/utils/libyang.cpp
@@ -1,29 +1,30 @@
 #include <fmt/format.h>
-#include <libyang/Tree_Data.hpp>
+#include <libyang-cpp/DataNode.hpp>
+#include <libyang-cpp/Set.hpp>
 #include "utils/libyang.h"
 
 namespace velia::utils {
 
-const char* getValueAsString(const libyang::S_Data_Node& node)
+const char* getValueAsString(const libyang::DataNode& node)
 {
-    if (!node || node->schema()->nodetype() != LYS_LEAF) {
+    if (node.schema().nodeType() != libyang::NodeType::Leaf) {
         throw std::logic_error("retrieveString: invalid node");
     }
 
-    return libyang::Data_Node_Leaf_List(node).value_str();
+    return node.asTerm().valueStr().data();
 }
 
-std::optional<libyang::S_Data_Node> getUniqueSubtree(const libyang::S_Data_Node& start, const char* path)
+std::optional<libyang::DataNode> getUniqueSubtree(const libyang::DataNode& start, const char* path)
 {
-    auto set = start->find_path(path);
+    auto set = start.findXPath(path);
 
-    switch(set->number()) {
+    switch(set.size()) {
     case 0:
         return std::nullopt;
     case 1:
-        return set->data().front();
+        return set.front();
     default:
-        throw std::runtime_error(fmt::format("getUniqueSubtree({}, {}): more than one match (got {})", start->path(), path, set->number()));
+        throw std::runtime_error(fmt::format("getUniqueSubtree({}, {}): more than one match (got {})", start.path().get().get(), path, set.size()));
     }
 }
 }
