---
title: "__escapeXml"
description: "JMeter __escapeXml function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values."
url: https://docs.jmeter.ai/functions/escapexml/
lastUpdated: 2026-10-01
source: docs.jmeter.ai
---

# __escapeXml

*Also documented in context in the [full Functions and Variables reference](/user-manual/functions/#__escapeXml).*

Function which escapes the characters in a String using XML 1.0 entities.

For example,

```bash
\${__escapeXml("bread" & 'butter')}
```

returns:
`"bread" & 'butter'`.

Uses `StringEscapeUtils#escapeXml10(String)` from Commons Lang.

| Name | Required | Description |
| --- | --- | --- |
| String to escape | Yes | The string to be escaped. |

## Related

- [Functions and Variables Guide](/topics/functions-and-variables/)
- [Regex Extractor Builder](/tools/regex-tester/)
- [Full Functions Reference](/user-manual/functions/)
- [Component Reference](/user-manual/component-reference/)
