--- title: "extract xml()" slug: "xml-extract" updated: 2026-08-17T13:04:35Z published: 2026-08-17T13:04:35Z canonical: "docs.lobstersoftware.com/xml-extract" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # extract xml() This function can extract a part from an XML file **a**, which is defined by the XPath expression **b**. If more than one element is supplied by the XPath expression, only the first element is used. ## Parameters | Parameter | Description | | --- | --- | | a | Name of the XML DOM object or XML as text. If no DOM object is found, the parameter value is interpreted as text. | | b | The XPath expression. | | c | (optional) If "true", errors are ignored. Default: "false". | | d | (optional) If "true", the XML declaration in the result XML is omitted. Default: "false". | | e | (optional) Name of the map for the namespace management. See examples for function [get value from XML()](/v1/docs/en/xml-get-value). | ## Example Let's assume the following XML file, which you specify in parameter **a** either directly or via the DOM object you previously read in using function [parse XML()](/v1/docs/en/xml-parse-xml). ```xml        Charter Group      
        100 Main         Framingham         MA         01701      
     
        720 Prospect         Framingham         MA         01701      
     
        120 Ridge         MA         01760      
 
``` In parameter **b** we use the XPath expression "//customers/customer/address". We leave parameters **c**, **d** and **e** empty. As a result, we then get the following XML. ```xml
100 Main Framingham MA 01701
``` XML (Extensible Markup Language) is a structured text format for storing and exchanging data. Content is enclosed within freely definable tags such as `<order>`. XML is human-readable, machine-processable, and platform-independent. In the Lobster Data Platform, you can receive, parse, and generate XML data.