diff --git a/tools/lint/commands.c b/tools/lint/commands.c
index 4b65a76..a8030ed 100644
--- a/tools/lint/commands.c
+++ b/tools/lint/commands.c
@@ -543,7 +543,7 @@
 }
 
 static int
-parse_data(char *filepath, int *options, struct lyd_node *val_tree, const char *rpc_act_file,
+parse_data(char *filepath, int *options, const struct lyd_node **trees, const char *rpc_act_file,
            struct lyd_node **result)
 {
     LYD_FORMAT informat = LYD_UNKNOWN;
@@ -641,26 +641,41 @@
                 fprintf(stderr, "RPC/action reply data require additional argument (file with the RPC/action).\n");
                 return EXIT_FAILURE;
             }
-            rpc_act = lyd_parse_path(ctx, rpc_act_file, informat, LYD_OPT_RPC, val_tree);
+            rpc_act = lyd_parse_path(ctx, rpc_act_file, informat, LYD_OPT_RPC, trees);
             if (!rpc_act) {
                 fprintf(stderr, "Failed to parse RPC/action.\n");
                 return EXIT_FAILURE;
             }
-            data = lyd_parse_path(ctx, filepath, informat, opts, rpc_act, val_tree);
+            if (trees) {
+                const struct lyd_node **trees_new;
+                unsigned int u;
+                trees_new = lyd_trees_new(1, rpc_act);
+
+                LY_ARRAY_FOR(trees, u) {
+                    trees_new = lyd_trees_add(trees_new, trees[u]);
+                }
+                lyd_trees_free(trees, 0);
+                trees = trees_new;
+            } else {
+                trees = lyd_trees_new(1, rpc_act);
+            }
+            data = lyd_parse_path(ctx, filepath, informat, opts, trees);
         } else if (opts & (LYD_OPT_RPC | LYD_OPT_NOTIF)) {
-            data = lyd_parse_path(ctx, filepath, informat, opts, val_tree);
+            data = lyd_parse_path(ctx, filepath, informat, opts, trees);
+#if 0
         } else if (opts & LYD_OPT_DATA_TEMPLATE) {
             if (!rpc_act_file) {
                 fprintf(stderr, "YANG-DATA require additional argument (name instance of yang-data extension).\n");
                 return EXIT_FAILURE;
             }
             data = lyd_parse_path(ctx, filepath, informat, opts, rpc_act_file);
+#endif
         } else {
             if (!(opts & LYD_OPT_TYPEMASK)) {
                 /* automatically add yang-library data */
                 opts |= LYD_OPT_DATA_ADD_YANGLIB;
             }
-            data = lyd_parse_path(ctx, filepath, informat, opts);
+            data = lyd_parse_path(ctx, filepath, informat, opts, NULL);
         }
 #if 0
     }
@@ -686,6 +701,7 @@
     char **argv = NULL, *ptr;
     const char *out_path = NULL;
     struct lyd_node *data = NULL, *val_tree = NULL;
+    const struct lyd_node **trees = NULL;
     LYD_FORMAT outformat = LYD_UNKNOWN;
     FILE *output = stdout;
     static struct option long_options[] = {
@@ -763,20 +779,21 @@
             out_path = optarg;
             break;
         case 'r':
-            if (val_tree || (options & LYD_OPT_NOEXTDEPS)) {
-                fprintf(stderr, "The running datastore (-r) cannot be set multiple times.\n");
-                goto cleanup;
-            }
             if (optarg[0] == '!') {
                 /* ignore extenral dependencies to the running datastore */
                 options |= LYD_OPT_NOEXTDEPS;
             } else {
                 /* external file with the running datastore */
-                val_tree = lyd_parse_path(ctx, optarg, LYD_XML, LYD_OPT_DATA_NO_YANGLIB);
+                val_tree = lyd_parse_path(ctx, optarg, LYD_XML, LYD_OPT_DATA_NO_YANGLIB, trees);
                 if (!val_tree) {
                     fprintf(stderr, "Failed to parse the additional data tree for validation.\n");
                     goto cleanup;
                 }
+                if (!trees) {
+                    trees = lyd_trees_new(1, val_tree);
+                } else {
+                    trees = lyd_trees_add(trees, val_tree);
+                }
             }
             break;
         case 's':
@@ -822,7 +839,7 @@
         goto cleanup;
     }
 
-    if (parse_data(argv[optind], &options, val_tree, argv[optind + 1], &data)) {
+    if (parse_data(argv[optind], &options, trees, argv[optind + 1], &data)) {
         goto cleanup;
     }
 
@@ -852,7 +869,7 @@
         fclose(output);
     }
 
-    lyd_free_all(val_tree);
+    lyd_trees_free(trees, 1);
     lyd_free_all(data);
 
     return ret;
diff --git a/tools/lint/main_ni.c b/tools/lint/main_ni.c
index 8b72e15..9b19ee1 100644
--- a/tools/lint/main_ni.c
+++ b/tools/lint/main_ni.c
@@ -322,6 +322,7 @@
     struct *subroot, *next, *node;
 #endif
     struct lyd_node *oper = NULL;
+    const struct lyd_node **trees = NULL;
     struct dataitem {
         const char *filename;
         struct lyd_node *tree;
@@ -803,11 +804,12 @@
                 fprintf(stderr, "yanglint error: The operational data are expected in XML or JSON format.\n");
                 goto cleanup;
             }
-            oper = lyd_parse_path(ctx, oper_file, informat_d, LYD_OPT_DATA_NO_YANGLIB | LYD_OPT_TRUSTED);
+            oper = lyd_parse_path(ctx, oper_file, informat_d, LYD_OPT_DATA_NO_YANGLIB | LYD_OPT_TRUSTED, NULL);
             if (!oper) {
                 fprintf(stderr, "yanglint error: Failed to parse the operational datastore file for RPC/Notification validation.\n");
                 goto cleanup;
             }
+            trees = lyd_trees_new(1, oper);
         }
 
         for (data_item = data, data_prev = NULL; data_item; data_prev = data_item, data_item = data_item->next) {
@@ -973,7 +975,7 @@
 #else
             {
 #endif
-                data_item->tree = lyd_parse_path(ctx, data_item->filename, data_item->format, options_parser, oper);
+                data_item->tree = lyd_parse_path(ctx, data_item->filename, data_item->format, options_parser, trees);
             }
             if (ly_err_first(ctx)) {
                 goto cleanup;
@@ -1107,7 +1109,7 @@
         lyd_free_all(data->tree);
         free(data);
     }
-    lyd_free_all(oper);
+    lyd_trees_free(trees, 1);
     ly_ctx_destroy(ctx, NULL);
 
     return ret;
