> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: XPath

> Extract data from an XML document using an XPath expression. Use XPATH for XML parsing and data extraction in Integrate.io ETL data pipelines.

## Description

Extracts part of an XML document using an [XPath](https://www.w3schools.com/xml/xpath_intro.asp "Link: https://www.w3schools.com/xml/xpath_intro.asp") expression.

## Syntax

`XPath(xml_string, xpath_string[, cache_xml_doc[, namespaces[, decode_xml]]])`

## Arguments

*xml\_string*  - string expression representing a well-formed XML.

*xpath\_string* - string expression representing an XPath expression.

*cache\_xml\_doc* (optional) - boolean flag cache last xml doc (better performance when using the function multiple times on the same XML doc). True by default.

*namespaces* (optional)- (string) an xml element that defines namespaces for the XPath engine to use. e.g. `<root xmlns:h="http://www.w3.org/TR/html4/" xmlns:f="https://www.w3schools.com/furniture"/>`

*decode\_xml* (optional) - boolean flag that defines if XML entities should be decoded. True by default.

## Examples

`XPath('<customer><firstname>John</firstname><lastname>Doe</lastname></customer>','/customer/firstname')`returns: John

## Return value datatype

String

## Impact of null value

If any of the inputs is null, returns null.
