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

# XML handling

> Learn how to translate XML content with the DeepL API.

<Info>
  We've released [tag handling v2](/docs/xml-and-html-handling/tag-handling-v2), providing major improvements to XML and HTML tag handling. Note that v2 enforces strict XML parsing.
</Info>

By default, the translation engine does not take tags into account. By setting the `tag_handling` parameter to `xml`, the API will process XML input by extracting the text out of the structure, splitting it into individual sentences, translating them, and placing them back into the XML structure.

For best results, also set the [`tag_handling_version` parameter](/docs/xml-and-html-handling/tag-handling-v2) to `v2` in your request.

<Info>
  For the translation of HTML content please see [HTML Handling](/docs/xml-and-html-handling/html)
</Info>

### Sentences with Markup

If you want to translate text where individual parts are marked up, you can simply activate the XML engine by setting `tag_handling` to `xml`. The following examples show marked-up text and how it will be translated:

<Tabs>
  <Tab title="Basic Example">
    ```markup Request theme={null}
    Press <i>Continue</i> to advance to the next page.
    ```

    ```markup Response theme={null}
    Drücken Sie <i>Weiter</i>, um zur nächsten Seite zu gelangen.
    ```
  </Tab>

  <Tab title="With Attributes">
    ```markup Request theme={null}
    <x id="17">Please welcome the participants</x> to today's meeting.
    ```

    ```markup Response theme={null}
    <x id="17">Bitte begrüßen Sie die Teilnehmer</x> des heutigen Treffens.
    ```
  </Tab>

  <Tab title="Nested Tags">
    ```markup Request theme={null}
    The firm said it had been conducting an <a>internal <b>investigation</b></a> for several months.
    ```

    ```markup Response theme={null}
    Das Unternehmen sagte, dass es seit mehreren Monaten eine <a>interne <b>Untersuchung</b></a>durchgeführt habe.
    ```
  </Tab>

  <Tab title="Placeholder Tag">
    ```markup Request theme={null}
    Artificial intelligence<a/> is already shaping our everyday<b></b> lives.
    ```

    ```markup Response theme={null}
    Künstliche Intelligenz<a/> prägt bereits heute unseren Alltag<b></b>.
    ```
  </Tab>
</Tabs>

In general, placeholders are associated with the words preceding or following them in the source sentence and are then applied to their respective translations in the target sentence.

### Ignored Tags

Use the `ignore_tags` parameter to specify that content within specific tags should not be translated. The example below uses `ignore_tags=x` to tell DeepL to preserve text between `<x> `and `</x>` tags as is.

<Card title="Example: ignore \<x\> tag">
  ```text Parameters theme={null}
  tag_handling=xml, ignore_tags=x
  ```

  ```markup Request theme={null}
  Please open the page <x>Settings</x> to configure your system.
  ```

  ```markup Response theme={null}
  Bitte öffnen Sie die Seite <x>Settings</x> um Ihr System zu konfigurieren.
  ```
</Card>
