---
title: previousSibling
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/xmlnode/previoussibling
---

# previousSibling

Returns the previous NSXMLNode object that is a sibling node to the receiver.

## Declaration

```swift
@NSCopying var previousSibling: XMLNode? { get }
```

## Discussion

Discussion This object will have an index value that is one less than the receiver’s. If there are no more previous siblings (that is, other child nodes of the receiver’s parent) the method returns nil

## See Also

### Navigating the Tree of Nodes

- [rootDocument](foundation/xmlnode/rootdocument.md)
- [parent](foundation/xmlnode/parent.md)
- [child(at:)](foundation/xmlnode/child(at:).md)
- [childCount](foundation/xmlnode/childcount.md)
- [children](foundation/xmlnode/children.md)
- [next](foundation/xmlnode/next.md)
- [nextSibling](foundation/xmlnode/nextsibling.md)
- [previous](foundation/xmlnode/previous.md)
- [detach()](foundation/xmlnode/detach().md)
