Data Processing
Extract values from XML documents using XPath expressions. Perfect for extracting specific data from complex nested XML structures, API responses, RSS feeds, and configuration files.
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/xml-path-extractor' \
-H 'Content-Type: application/json' \
-d '{"xmlInput":"Enter your XML data...","xpathExpressions":"//*","outputFormat":"list","includePaths":true,"includeAttributes":false,"flattenArrays":true,"preserveOrder":true,"namespaceAware":false,"nullValues":false}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/xml-path-extractor| Name | Type | Required | Description |
|---|---|---|---|
| xmlInput | textarea | Yes | — |
| xpathExpressions | textarea | No | XPath expressions to extract values. Examples: //* - All elements //book/title - All book titles //person[@age>18] - Persons older than 18 Leave empty to extract all elements |
| outputFormat | select | Yes | — |
| includePaths | checkbox | No | Include the XPath expression used for each extraction |
| includeAttributes | checkbox |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-xml-path-extractor": {
"name": "xml-path-extractor",
"description": "Extract values from XML documents using XPath expressions. Perfect for extracting specific data from complex nested XML structures, API responses, RSS feeds, and configuration files.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=xml-path-extractor",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "xml-path-extractor",
"arguments": {
"xmlInput": "Enter your XML data...",
"xpathExpressions": "//*",
"outputFormat": "list",
"includePaths": true,
"includeAttributes": false,
"flattenArrays": true,
"preserveOrder": true,
"namespaceAware": false,
"nullValues": false
}
}
}| Include attributes for extracted elements |
| flattenArrays | checkbox | No | Treat multiple results as individual items instead of arrays |
| preserveOrder | checkbox | No | Maintain the original order of elements in the XML document |
| namespaceAware | checkbox | No | Enable namespace-aware XPath evaluation |
| nullValues | checkbox | No | Include empty elements and null values in the extraction results |
Text result
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Questions or issues? Contact [email protected]