---
title: "elements(forLocalName:uri:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/xmlelement/elements(forlocalname:uri:)"
---

# elements(forLocalName:uri:)

Returns the child element nodes (as NSXMLElement objects) of the receiver that are matched with the specified local name and URI.

## Declaration

```swift
func elements(forLocalName localName: String, uri URI: String?) -> [XMLElement]
```

## Parameters

- `localName`: A string specifying a local name of an element.
- `URI`: A string specifying a URI associated with an element.

## Return Value

Return Value An array of NSXMLElement objects or an empty array if no matching children could be found.

## See Also

### Obtaining Child Elements

- [elements(forName:)](foundation/xmlelement/elements(forname:).md)
