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

# removeChild(at:)

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

## Declaration

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

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

## See Also

### Manipulating Child Elements

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