---
schema_version: "1"
id: 3145d34284b62694ab55e98d51f3bbde118e1a0f6ae619ce7f3925e1e1cb32de
title: Tree (dw::util::Tree)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-tree.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-tree
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f4918b041a3422ff3b568648a65b583a9feb4e5a9420077fd1f74317f8b7a85e
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# Tree (dw::util::Tree)

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

This utility module provides functions that enable you to handle values as though they are tree data
structures.

The module is included with Mule runtime. To use it, you must import it into your DataWeave code,
for example, by adding the line `import * from dw::util::Tree` to the header of your script.

_Introduced in DataWeave 2.2.2. Supported by Mule 4.2.2 and later._

## Functions

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-tree-functions-asexpressionstring">asExpressionString</a></p></td><td><p>Transforms a path to a string representation.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-tree-functions-mapleafvalues">mapLeafValues</a></p></td><td><p>Maps the terminal (leaf) nodes in the tree.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/dataweave/2.3/dw-tree-functions-nodeexists">nodeExists</a></p></td><td><p>Returns <code>true</code> if any node in the tree validates against the specified criteria.</p></td></tr></tbody></table>

## Variables

- [Tree Variables](https://docs.mulesoft.com/dataweave/2.3/dw-tree-variables)

## Types

- [Tree Types](https://docs.mulesoft.com/dataweave/2.3/dw-tree-types)
