---
title: "element(withName:uri:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/xmlnode/element(withname:uri:)"
---

# element(withName:uri:)

Returns an element whose fully qualified name is specified.

## Declaration

```swift
class func element(withName name: String, uri URI: String) -> Any
```

## Parameters

- `name`: A string that is the name (or tag identifier) of an element.
- `URI`: A URI (Universal Resource Identifier) that qualifies name.

## Return Value

Return Value An XMLElement object or nil if the object cannot be created.

## Discussion

Discussion The equivalent XML markup is <URI:``name``>``</URI:``name``>.

## See Also

### Creating and Initializing Node Objects

- [init(kind:)](foundation/xmlnode/init(kind:).md)
- [init(kind:options:)](foundation/xmlnode/init(kind:options:).md)
- [document()](foundation/xmlnode/document().md)
- [document(withRootElement:)](foundation/xmlnode/document(withrootelement:).md)
- [element(withName:)](foundation/xmlnode/element(withname:).md)
- [element(withName:children:attributes:)](foundation/xmlnode/element(withname:children:attributes:).md)
- [element(withName:stringValue:)](foundation/xmlnode/element(withname:stringvalue:).md)
- [attribute(withName:stringValue:)](foundation/xmlnode/attribute(withname:stringvalue:).md)
- [attribute(withName:uri:stringValue:)](foundation/xmlnode/attribute(withname:uri:stringvalue:).md)
- [text(withStringValue:)](foundation/xmlnode/text(withstringvalue:).md)
- [comment(withStringValue:)](foundation/xmlnode/comment(withstringvalue:).md)
- [namespace(withName:stringValue:)](foundation/xmlnode/namespace(withname:stringvalue:).md)
- [dtdNode(withXMLString:)](foundation/xmlnode/dtdnode(withxmlstring:).md)
- [predefinedNamespace(forPrefix:)](foundation/xmlnode/predefinednamespace(forprefix:).md)
- [processingInstruction(withName:stringValue:)](foundation/xmlnode/processinginstruction(withname:stringvalue:).md)
