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

# CFXMLTreeCreateWithDataFromURL

Creates a new CFXMLTree object by loading the data to be parsed directly from a data source.

## Declaration

```occ
extern CFXMLTreeRefCFXMLTreeCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes);
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `dataSource`: The URL from which the XML data is obtained. The URL is used to resolve any relative references found in XML Data. Pass NULL if a valid URL is unavailable.
- `parseOptions`: Flags which control how the XML data will be parsed. See doc://com.apple.corefoundation/documentation/CoreFoundation/CFXMLParserOptions for the list of available options.
- `versionOfNodes`: Determines which version of CFXMLNode objects are produced by the parser.

## Return Value

Return Value A new CFXMLTree object containing the data from the specified XML data source. Ownership follows the The Create Rule.

## See Also

### CFXMLTree Miscellaneous Functions

- [CFXMLCreateStringByEscapingEntities(_:_:_:)](corefoundation/cfxmlcreatestringbyescapingentities(_:_:_:).md)
- [CFXMLCreateStringByUnescapingEntities(_:_:_:)](corefoundation/cfxmlcreatestringbyunescapingentities(_:_:_:).md)
- [CFXMLTreeCreateFromData](corefoundation/cfxmltreecreatefromdata.md)
- [CFXMLTreeCreateFromDataWithError](corefoundation/cfxmltreecreatefromdatawitherror.md)
- [CFXMLTreeCreateWithNode](corefoundation/cfxmltreecreatewithnode.md)
- [CFXMLTreeCreateXMLData](corefoundation/cfxmltreecreatexmldata.md)
- [CFXMLTreeGetNode](corefoundation/cfxmltreegetnode.md)
