<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/XMLNode/index",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSXMLNode(py)index"
  },
  "title" : "index"
}
-->

# index

Returns the index of the receiver identifying its position relative to its sibling nodes.

```
var index: Int { get }
```

## Return Value

An integer that is the index of the receiver relative to its sibling nodes.

## Discussion

The first child node of a parent has an index of zero.

## See Also

[`child(at:)`](/documentation/Foundation/XMLNode/child(at:))

Returns the child node of the receiver at the specified location.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)