> ## Documentation Index
> Fetch the complete documentation index at: https://ago.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# XML Import

> Import and convert XML feeds into structured knowledge documents

Import content from XML feeds by fetching an XML file from a URL and converting each item element into a knowledge document. Useful for product catalogs, RSS-style feeds, or any structured XML data.

| Feature            | Details                          |
| ------------------ | -------------------------------- |
| **Authentication** | None (fetches from URL)          |
| **Content type**   | XML feeds / structured data      |
| **Hierarchy**      | Flat (one document per XML item) |
| **Multi-language** | No                               |
| **Attachments**    | No                               |

## Prerequisites

1. A publicly accessible URL serving an XML file
2. Knowledge of your XML structure (element names, field names)

## Setup Steps

1. Navigate to **Knowledge** > **Sources** > **Create**
2. Select **XML** as the connector type
3. Enter the **URL** of your XML feed
4. Configure the field mapping (see Configuration below)
5. Save and run a manual sync

## Configuration

| Setting        | Required | Default    | Description                                                                                                      |
| -------------- | -------- | ---------- | ---------------------------------------------------------------------------------------------------------------- |
| URL            | Yes      | —          | The URL to fetch the XML file from                                                                               |
| Item element   | No       | `item`     | The XML element name that represents a single record (e.g., `item`, `record`, `entry`)                           |
| Title field    | No       | `title`    | The field within each item to use as the document title                                                          |
| ID field       | No       | `id`       | The field within each item to use as the document identifier                                                     |
| Content fields | No       | All fields | Specific fields to include in the document content. If empty, all fields except the title and ID are included    |
| Exclude fields | No       | None       | Field name prefixes to exclude from the import (e.g., `internal_` to skip all fields starting with "internal\_") |

## XML Format Example

Given this XML:

```xml theme={null}
<catalog>
  <item>
    <id>123</id>
    <title>Product Name</title>
    <description>A detailed product description.</description>
    <category>Electronics</category>
  </item>
  <item>
    <id>456</id>
    <title>Another Product</title>
    <description>Another description here.</description>
    <category>Books</category>
  </item>
</catalog>
```

With default settings (`item_element: "item"`, `title_field: "title"`, `id_field: "id"`), this creates two documents:

* **Document 1**: Title "Product Name", content includes description and category
* **Document 2**: Title "Another Product", content includes description and category

## What Gets Imported

Each item element in the XML becomes one knowledge document:

* **Title**: The value of the configured title field
* **Content**: All other fields formatted as a readable list (or only the fields specified in "Content fields")
* **Metadata**: All field values are stored as document metadata for search

Nested XML elements are flattened with underscores (e.g., a `<author><name>` element becomes `author_name`). Element attributes are also captured.

## Troubleshooting

<AccordionGroup>
  <Accordion title="No documents imported">
    * Verify the URL returns valid XML
    * Check that the item element name matches your XML structure
    * Ensure the URL is publicly accessible (private/localhost URLs are blocked)
  </Accordion>

  <Accordion title="Missing content">
    * Check the content fields configuration — if specific fields are listed, only those are included
    * Verify field names match the XML element names exactly
    * Check that exclude field prefixes aren't filtering out wanted content
  </Accordion>

  <Accordion title="Wrong titles or IDs">
    * Verify the title and ID field names match your XML structure
    * Documents with empty title fields will get a generic "XML Record #N" title

    ***
  </Accordion>
</AccordionGroup>

## Related

* [Knowledge Connectors](./knowledge-connectors) — All available connectors
* [JSON Integration](./json-integration) — Similar import for JSON files
* [Knowledge Source Management](../features/knowledge-source-management) — Managing sources
