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

# removeChild(at:)

Removes the child node of the receiver identified by a given index.

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

## Parameters

`index`

An integer identifying the node in the receiver’s list of children to remove. An exception is raised if `index` is out of bounds.

## Discussion

The XML node object is released upon removal. The indices of subsequent children are decremented by one.

---

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)