---
title: "xmlString(options:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/xmlnode/xmlstring(options:)"
---

# xmlString(options:)

Returns the string representation of the receiver as it would appear in an XML document, with one or more output options specified.

## Declaration

```swift
func xmlString(options: XMLNode.Options = []) -> String
```

## Parameters

- `options`: One or more enum constants identifying an output option; bit-OR multiple constants together. See Constants for a list of valid constants for specifying output options.

## Discussion

Discussion The returned string includes the string representations of all children.

## See Also

### Emitting Node Content

- [xmlString](foundation/xmlnode/xmlstring.md)
- [canonicalXMLStringPreservingComments(_:)](foundation/xmlnode/canonicalxmlstringpreservingcomments(_:).md)
- [description](foundation/xmlnode/description.md)
