# 📦 Extracting XML and XML ADF

Source: https://help.airparser.com/data-extraction/extracting-xml

Airparser can read XML that arrives in your emails and documents, for example **ADF (Auto-lead Data Format)** leads that dealerships receive from car marketplaces and websites. Choose how Airparser should treat XML in each inbox.

## Which mode to choose

- **ADF lead → your fields**. Airparser finds the ADF lead and fills the fields of your Extraction Schema from it. Works with the Text and the Vision engine.
- **Raw XML as JSON**. Converts any XML it finds to JSON exactly as it is and ignores your fields. Text engine only. This is the former “Extract XML from documents” option.
- **Off**. XML is not treated in a special way (default).

## ADF lead → your fields

Airparser looks for the ADF lead in:

- the text of the email, and in its HTML (also when the XML is shown as text, with the tags escaped);
- an attached **.xml** file or an uploaded .xml file;
- text files (.txt).

If there is no ADF in the document, or the XML is not valid, the document is parsed in the usual way using your Extraction Schema.

There are two ways to set up the fields:

**1. Use the standard ADF field names.** If every field of your schema is named like one of the keys below, the values are taken straight from the XML, without AI. Typed fields (number, date) are converted as usual.

- **Lead:** request\_date, lead\_id, lead\_id\_source, lead\_sequence, prospect\_status
- **Vehicle:** vehicle\_interest, vehicle\_status, vehicle\_year, vehicle\_make, vehicle\_model, vehicle\_trim, vehicle\_vin, vehicle\_stock, vehicle\_price, vehicle\_price\_type, vehicle\_currency, vehicle\_odometer, vehicle\_condition, vehicle\_bodystyle, vehicle\_transmission, vehicle\_options, vehicle\_comments
- **Customer:** customer\_first\_name, customer\_last\_name, customer\_full\_name, customer\_email, customer\_phone, customer\_street, customer\_city, customer\_region, customer\_postal\_code, customer\_country, customer\_timeframe, customer\_comments
- **Dealer and source:** vendor\_name, vendor\_id, vendor\_contact\_name, provider\_name, provider\_service, provider\_email, provider\_phone

**2. Use your own field names** (for example lead\_name or vehicle\_of\_interest). Airparser reads the ADF first and AI only matches the lead to your fields, so the XML itself is never misread.

Vehicles and leads:

- The vehicle fields come from the vehicle the customer wants to buy (the first one with interest="buy"). A trade-in vehicle and any other vehicle are available in a **vehicles** list (add a list field named vehicles to your schema; its fields are interest, make, model, year, trim, vin, stock, price and so on).
- If one ADF holds several leads, your fields are filled from the first lead and all leads are returned in a **prospects** list.

Example result for a schema with customer\_first\_name, customer\_email, vehicle\_make and vehicle\_price:

`{ "customer_first_name": "Maria", "customer_email": "maria.lopez@example.net", "vehicle_make": "Honda", "vehicle_price": 24950 }`

Each document uses 1 credit, as usual.

A sample ADF lead you can download, the field reference and the example result are on the [ADF XML page](https://airparser.com/adf-xml/).

## Raw XML as JSON

Airparser converts the XML it finds in the document to JSON as it is: the same nesting, with attributes marked by @\_ (for example `@_part`) and a name split into parts becomes a list. Your Extraction Schema is not applied to this result, and it is used only as a backup when no XML is found, so you still need a schema (even with one field). This mode works only with the **Text engine**.

## How to enable

**Quickest way for dealer leads: start from the ADF lead template.** Click **New inbox**, open **Advanced settings**, choose **Inbox template** → **ADF XML (car dealer leads)** and create the inbox. The XML / ADF mode is already on and the Extraction Schema already has the standard ADF fields, so the first ADF lead is read straight from the XML and there is nothing to set up. You can edit the fields later. A link with `?template=adf` (app.airparser.com/new?template=adf) opens the page with the template chosen.

![Shot 2026-10-29 at 14.26.44@2x.jpg](https://cdn.eniston.com/bases/539620d4-93af-413a-b051-73249e9322a9/attachments/1793280500_6ae349f414a81.jpg)

**In an existing inbox:** open the inbox, go to **Settings** → **General**, find **XML / ADF leads**, choose a mode and click **Save**.

![Shot 2026-10-29 at 14.28.55@2x.jpg](https://cdn.eniston.com/bases/539620d4-93af-413a-b051-73249e9322a9/attachments/1793280578_6ae34a42902f2.jpg)

The **.xml** format is on by default in every inbox (**Settings** → **General** → **File types**, group **Data files**). If you turn it off there, .xml files and .xml attachments are ignored.

## Tips

- Existing documents are not changed. Reprocess them if you want the new mode to apply.
- If your leads arrive as ADF in the email text or as a .xml attachment, you do not need any other setting. To skip the email text and process only attachments (or the other way round), use **Email processing** in the same settings tab.
