# XPath Action

The **XPath Action** node extracts a value from an XML file using an XPath expression.

It reads the specified XML file, evaluates the provided XPath expression, and returns the extracted value as the node result. This makes it possible to pass XML-based metadata into a stream and use it in later steps (for example, writing it into job metadata or sending it to external systems).

This node is commonly used for stable metadata exchange with third-party systems such as TIXstream.

#### Input Parameters

**XML Path**\
Full path to the XML file (including filename and extension) that should be read.

**XPath Expression**\
XPath expression used to locate and extract the desired value (e.g., `/MetadataExchange/EpisodeTitle/text()`).

<figure><img src="/files/qGdX5B8dshTPsPDcffQy" alt="" width="351"><figcaption><p>XPath Action</p></figcaption></figure>

#### Output and Wildcards

The extracted value is returned as the node result and can be accessed via:

* [{stream.last\_result}](/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result.md)
* [{node.result.?}](/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/node-result.md)

This allows the value to be reused throughout the stream, for example as input for metadata nodes or conditional logic.

#### Behavior

* Reads an XML file from disk
* Evaluates the XPath expression
* Returns the extracted value as a string
* Supports asynchronous execution

The node fails if the file cannot be read or the XPath expression is invalid.

#### Typical Use Cases

* extracting metadata from XML sidecar files
* mapping XML values into job metadata fields
* driving workflow logic based on XML values
* integration with external systems (e.g., TIXstream)
* automated naming and routing decisions based on XML content

#### Practical Tip

Use XPath expressions that explicitly return a text node (e.g., `.../text()`) to avoid receiving an XML element instead of a simple value.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/nodes/actions/misc-21/xpath-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
