---
title: XMLNode.Options
framework: foundation
role: symbol
role_heading: Structure
path: foundation/xmlnode/options
---

# XMLNode.Options

These constants are input and output options for all NSXMLNode objects (unless otherwise indicated), including XMLDocument objects. You can specify these options in the NSXMLNode methods init(kind:options:) and xmlString(options:).

## Declaration

```swift
struct Options
```

## Overview

Overview The options with “Preserve” in their names are applicable only when external sources of XML are parsed; they have no effect on node objects that are programmatically created. Other options are used in initialization and output methods of NSXMLDocument; see the XMLDocument reference documentation for details.

## Topics

### Constants

- [documentIncludeContentTypeDeclaration](foundation/xmlnode/options/documentincludecontenttypedeclaration.md)
- [documentTidyHTML](foundation/xmlnode/options/documenttidyhtml.md)
- [documentTidyXML](foundation/xmlnode/options/documenttidyxml.md)
- [documentValidate](foundation/xmlnode/options/documentvalidate.md)
- [documentXInclude](foundation/xmlnode/options/documentxinclude.md)
- [nodeCompactEmptyElement](foundation/xmlnode/options/nodecompactemptyelement.md)
- [nodeExpandEmptyElement](foundation/xmlnode/options/nodeexpandemptyelement.md)
- [nodeIsCDATA](foundation/xmlnode/options/nodeiscdata.md)
- [nodeLoadExternalEntitiesAlways](foundation/xmlnode/options/nodeloadexternalentitiesalways.md)
- [nodeLoadExternalEntitiesNever](foundation/xmlnode/options/nodeloadexternalentitiesnever.md)
- [nodeLoadExternalEntitiesSameOriginOnly](foundation/xmlnode/options/nodeloadexternalentitiessameoriginonly.md)
- [nodeNeverEscapeContents](foundation/xmlnode/options/nodeneverescapecontents.md)
- [nodePreserveAll](foundation/xmlnode/options/nodepreserveall.md)
- [nodePreserveAttributeOrder](foundation/xmlnode/options/nodepreserveattributeorder.md)
- [nodePreserveCDATA](foundation/xmlnode/options/nodepreservecdata.md)
- [nodePreserveCharacterReferences](foundation/xmlnode/options/nodepreservecharacterreferences.md)
- [nodePreserveDTD](foundation/xmlnode/options/nodepreservedtd.md)
- [nodePreserveEmptyElements](foundation/xmlnode/options/nodepreserveemptyelements.md)
- [nodePreserveEntities](foundation/xmlnode/options/nodepreserveentities.md)
- [nodePreserveNamespaceOrder](foundation/xmlnode/options/nodepreservenamespaceorder.md)
- [nodePreservePrefixes](foundation/xmlnode/options/nodepreserveprefixes.md)
- [nodePreserveQuotes](foundation/xmlnode/options/nodepreservequotes.md)
- [nodePreserveWhitespace](foundation/xmlnode/options/nodepreservewhitespace.md)
- [nodePrettyPrint](foundation/xmlnode/options/nodeprettyprint.md)
- [nodePromoteSignificantWhitespace](foundation/xmlnode/options/nodepromotesignificantwhitespace.md)
- [nodeUseDoubleQuotes](foundation/xmlnode/options/nodeusedoublequotes.md)
- [nodeUseSingleQuotes](foundation/xmlnode/options/nodeusesinglequotes.md)

### Initializers

- [init(rawValue:)](foundation/xmlnode/options/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [ExpressibleByArrayLiteral](swift/expressiblebyarrayliteral.md)
- [OptionSet](swift/optionset.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SetAlgebra](swift/setalgebra.md)

## See Also

### Constants

- [XMLNode.Kind](foundation/xmlnode/kind-swift.enum.md)
