# format_xml

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/agents/format_scratchpad/xml/format_xml)

Format the intermediate steps as XML.

## Signature

```python
format_xml(
    intermediate_steps: list[tuple[AgentAction, str]],
    *,
    escape_format: Literal['minimal'] | None = 'minimal',
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `intermediate_steps` | `list[tuple[AgentAction, str]]` | Yes | The intermediate steps. |
| `escape_format` | `Literal['minimal'] \| None` | No | The escaping format to use. Currently only 'minimal' is supported, which replaces XML tags with custom delimiters to prevent conflicts. (default: `'minimal'`) |

## Returns

`str`

The intermediate steps as XML.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/langchain/langchain_classic/agents/format_scratchpad/xml.py#L21)