---
title: level
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/xmlnode/level
---

# level

Returns the nesting level of the receiver within the tree hierarchy.

## Declaration

```swift
var level: Int { get }
```

## Return Value

Return Value An integer indicating a nesting level.

## Discussion

Discussion The root element of a document has a nesting level of one.

## See Also

### Managing XML Node Objects

- [index](foundation/xmlnode/index.md)
- [kind](foundation/xmlnode/kind-swift.property.md)
- [name](foundation/xmlnode/name.md)
- [objectValue](foundation/xmlnode/objectvalue.md)
- [stringValue](foundation/xmlnode/stringvalue.md)
- [setStringValue(_:resolvingEntities:)](foundation/xmlnode/setstringvalue(_:resolvingentities:).md)
- [setURI:](foundation/nsxmlnode-seturi.md)
- [uri](foundation/xmlnode/uri.md)
