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

# __XPath

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

The XPath function reads an XML file and matches the XPath.
Each time the function is called, the next match will be returned.
At end of file, it will wrap around to the start.
If no nodes matched, then the function will return the empty string,
and a warning message will be written to the JMeter log file.

> **Note**
> Note that the entire NodeList is held in memory.

Example:

```bash
\${__XPath(/path/to/build.xml, //target/@name)}
```

This will match all targets in `build.xml` and return the contents of the next name attribute

| Name | Required | Description |
| --- | --- | --- |
| XML file to parse | Yes | a XML file to parse |
| XPath | Yes | a XPath expression to match nodes in the XML file |

## 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/)
