<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/XMLDocument/removeChild(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSXMLDocument(im)removeChildAtIndex:"
  },
  "title" : "removeChild(at:)"
}
-->

# removeChild(at:)

Removes the child node of the receiver located at a specified position in its array of children.

```
func removeChild(at index: Int)
```

## Parameters

`index`

An integer identifying the position of an child in the receiver’s array. If `index` is less than zero or greater than the number of children minus one, an out-of-bounds exception is raised.

## Discussion

Subsequent children have their indexes decreased by one. The removed [`XMLNode`](/documentation/Foundation/XMLNode) object is autoreleased.

---

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)