data tree FEATURE anydata copy function made public
diff --git a/src/tree_data.h b/src/tree_data.h
index 2aabf8f..876556b 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -439,6 +439,16 @@
 int lyd_lyb_data_length(const char *data);
 
 /**
+ * @brief Copy anydata value from one node to another. Target value is freed first.
+ *
+ * @param[in,out] trg Target node.
+ * @param[in] value Source value, may be NULL when the target value is only freed.
+ * @param[in] value_type Source value type.
+ * @return LY_ERR value.
+ */
+LY_ERR lyd_any_copy_value(struct lyd_node *trg, const union lyd_any_value *value, LYD_ANYDATA_VALUETYPE value_type);
+
+/**
  * @brief Create a new inner node in the data tree.
  *
  * @param[in] parent Parent node for the node being created. NULL in case of creating a top level element.
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index 7551667..28de6a1 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -206,7 +206,7 @@
     }
 }
 
-LY_ERR
+API LY_ERR
 lyd_any_copy_value(struct lyd_node *trg, const union lyd_any_value *value, LYD_ANYDATA_VALUETYPE value_type)
 {
     struct lyd_node_any *t;
diff --git a/src/tree_data_internal.h b/src/tree_data_internal.h
index 9de80fc..166cd12 100644
--- a/src/tree_data_internal.h
+++ b/src/tree_data_internal.h
@@ -468,16 +468,6 @@
 void lyd_parse_set_data_flags(struct lyd_node *node, struct ly_set *when_check, struct lyd_meta **meta, int options);
 
 /**
- * @brief Copy anydata value from one node to another. Target value is freed first.
- *
- * @param[in,out] trg Target node.
- * @param[in] value Source value, may be NULL when the target value is only freed.
- * @param[in] value_type Source value type.
- * @return LY_ERR value.
- */
-LY_ERR lyd_any_copy_value(struct lyd_node *trg, const union lyd_any_value *value, LYD_ANYDATA_VALUETYPE value_type);
-
-/**
  * @brief Free value prefixes.
  *
  * @param[in] ctx libyang context.