<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/document-content-types",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Document Content Types"
}
-->

# Document Content Types

Define document types.

## Discussion

You specify one of the NSXMLDocumentContentKind constants in [`documentContentKind`](/documentation/Foundation/XMLDocument/documentContentKind) to indicate the kind of content required for document output.

## Topics

### Constants

[`case xml`](/documentation/Foundation/XMLDocument/ContentKind/xml)

The default type of document content type, which is XML.

[`case xhtml`](/documentation/Foundation/XMLDocument/ContentKind/xhtml)

The document output is XHTML.

[`case html`](/documentation/Foundation/XMLDocument/ContentKind/html)

Outputs empty tags in HTML without a close tag, such as `<br>`.

[`case text`](/documentation/Foundation/XMLDocument/ContentKind/text)

Outputs the string value of the document by extracting the string values from all text nodes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)