# Connecting to XML Datasources

After connecting to your data source, set DataModel to more closely match the data representation to the structure of your data.

### Connecting to XML

Below are example connection strings to XML files or streams, using the provider's default data modeling configuration (see below):

| **Service provider**            | **URI formats**                                                                                                                    | **Connection example**                                                                                                                                                                                    |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Local                           | <p>localPath</p><p>file:///localPath/file.xml</p>                                                                                  | URI=C:\folder1\file.xml;                                                                                                                                                                                  |
| HTTP or HTTPS                   | <p><http://remoteStream></p><p><https://remoteStream></p>                                                                          | URI=<http://www.host1.com/streamname1>;                                                                                                                                                                   |
| Amazon S3                       | s3://bucket1/folder1/file.xml                                                                                                      | URI=s3://bucket1/folder1/file.xml; AWSAccessKey=token1; AWSSecretKey=secret1; AWSRegion=OHIO;                                                                                                             |
| Azure Blob Storage              | azureblob://mycontainer/myblob/                                                                                                    | URI=azureblob://mycontainer/myblob; AzureAccount=myAccount; AzureAccessKey=myKey;                                                                                                                         |
| Google Drive                    | gdrive://remotePath/file.xml                                                                                                       | URI=gdrive://folder1/file.xml;InitiateOAuth=GETANDREFRESH;                                                                                                                                                |
| Box                             | box://remotePath/file.xml                                                                                                          | URI=box://folder1/file.xml; InitiateOAuth=GETANDREFRESH;                                                                                                                                                  |
| Dropbox                         | dropbox://remotePath/file.xml                                                                                                      | URI=dropbox://folder1/file.xml; InitiateOAuth=GETANDREFRESH; OAuthClientId=oauthclientid1; OAuthClientSecret=oauthcliensecret1; CallbackUrl=<http://localhost:12345>;                                     |
| Sharepoint                      | sp\://remotePath/file.xml                                                                                                          | URI=sp\://Documents/folder1/file.xml; User=user1; Password=password1; SharepointUrl=<https://subdomain.sharepoint.com>;                                                                                   |
| FTP or FTPS                     | <p>ftp\://server:port/remotePath/file.xml</p><p> ftps\://server:port/remotepath/file.xml</p>                                       | URI=ftps\://localhost:990/folder1/file.xml; User=user1; Password=password1;                                                                                                                               |
| AzureDataLakeStoreGen2          | <p>abfs\://myfilesystem/remotePath/file.xml</p><p> abfss\://myfilesystem\@accountName.dfs.core.windows.net/remotepath/file.xml</p> | <p>URI=abfs\://myfilesystem/folder1/file.xml; AzureAccount=myAccount; AzureAccessKey=myKey;</p><p> URI=abfss\://myfilesystem\@myAccount.dfs.core.windows.net/folder1/file.xml; AzureAccessKey=myKey;</p>  |
| AzureDataLakeStoreGen2 with SSL | <p>abfss\://myfilesystem/remotePath/file.xml</p><p> abfs\://myfilesystem\@accountName.dfs.core.windows.net/remotepath/file.xml</p> | <p>URI=abfss\://myfilesystem/folder1/file.xml; AzureAccount=myAccount; AzureAccessKey=myKey;</p><p> URI=abfss\://myfilesystem\@myAccount.dfs.core.windows.net/folder1/file.xml; AzureAccessKey=myKey;</p> |
| Wasabi                          | wasabi://bucket/remotePath/file.xml                                                                                                | URI=wasabi://bucket/folder1/file.xml; AWSAccessKey=token1; AWSSecretKey=secret1; AWSRegion=NorthenVirginia;                                                                                               |

### Modeling XML Data

The DataModel property is the controlling property over how your data is represented into tables and toggles the following basic configurations.

* **Document** (default): Model a top-level, document view of your XML data. The provider returns nested elements as aggregated XML.
* **FlattenedDocuments**: Detect nested documents and implicitly join them into a single table.
* **Relational**: Return individual, related tables from hierarchical data. The tables contain a primary key and a foreign key that links to the parent document.

See [Parsing Hierarchical Data](/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/services/xml/parsing-hierarchical-data.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/services/xml/connecting-to-xml-datasources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
