---
title: "removeChild(at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/xmldocument/removechild(at:)"
---

# removeChild(at:)

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

## Declaration

```swift
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

Discussion Subsequent children have their indexes decreased by one. The removed XMLNode object is autoreleased.

## See Also

### Adding and Removing Child Nodes

- [addChild(_:)](foundation/xmldocument/addchild(_:).md)
- [insertChild(_:at:)](foundation/xmldocument/insertchild(_:at:).md)
- [insertChildren(_:at:)](foundation/xmldocument/insertchildren(_:at:).md)
- [replaceChild(at:with:)](foundation/xmldocument/replacechild(at:with:).md)
- [setChildren(_:)](foundation/xmldocument/setchildren(_:).md)
