---
title: CFXMLNodeCreate
framework: Core Foundation
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: corefoundation/cfxmlnodecreate
---

# CFXMLNodeCreate

Creates a new CFXMLNode.

## Declaration

```occ
extern CFXMLNodeRefCFXMLNodeCreate(CFAllocatorRef alloc, CFXMLNodeTypeCode xmlType, CFStringRef dataString, const void *additionalInfoPtr, CFIndex version);
```

## Parameters

- `alloc`: The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `xmlType`: Type identifier code for the XML structure you want this node to describe.
- `dataString`: The XML data.
- `additionalInfoPtr`: A pointer to a structure containing additional information about the XML data.
- `version`: The version number of the CFXMLNode object you want to create. Pass one of the pre-defined constants, typically doc://com.apple.corefoundation/documentation/CoreFoundation/kCFXMLNodeCurrentVersion.

## Return Value

Return Value A new CFXMLNode object. Ownership follows the The Create Rule.

## See Also

### CFXMLNode Miscellaneous Functions

- [CFXMLNodeCreateCopy](corefoundation/cfxmlnodecreatecopy.md)
- [CFXMLNodeGetInfoPtr](corefoundation/cfxmlnodegetinfoptr.md)
- [CFXMLNodeGetString](corefoundation/cfxmlnodegetstring.md)
- [CFXMLNodeGetTypeCode](corefoundation/cfxmlnodegettypecode.md)
- [CFXMLNodeGetTypeID](corefoundation/cfxmlnodegettypeid.md)
- [CFXMLNodeGetVersion](corefoundation/cfxmlnodegetversion.md)
