# xarray.DataTree.to_dataset

#### DataTree.to_dataset(inherit=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/datatree.py#L715-L750)

Return the data in this node as a new xarray.Dataset object.

* **Parameters:**
  **inherit** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or `{"all_coords", "indexes"}`, *default* [`True`](https://docs.python.org/3/builtins/constants.html#True)) – Controls which coordinates are inherited from parent nodes.
  - True or “indexes”: inherit only indexed coordinates (default).
  - “all_coords”: inherit all coordinates, including non-index coordinates.
  - False: only include coordinates defined at this node.

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