# xarray.load_datatree

### xarray.load_datatree(filename_or_obj, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/backends/api.py#L196-L219)

Open, load into memory, and close a DataTree from a file or file-like
object.

This is a thin wrapper around [`open_datatree()`](xarray.open_datatree.html.md#xarray.open_datatree). It differs
from open_datatree in that it loads the DataTree into memory, closes the
file, and returns the DataTree. In contrast, open_datatree keeps the file
handle open and lazy loads its contents. All parameters are passed directly
to open_datatree. See that documentation for further details.

* **Returns:**
  **datatree** ([`DataTree`](xarray.DataTree.html.md#xarray.DataTree)) – The newly created DataTree.

#### SEE ALSO
[`open_datatree`](xarray.open_datatree.html.md#xarray.open_datatree)
