# Flatten namespaced order XML into Excel columns

**Use case:** 

Strip XML namespace prefixes, select order nodes, include attributes, and keep a controlled set of nested columns for recurring spreadsheet imports.

## Input

```json
{
  "xmlText": "<catalog><book id=\"bk-101\"><title>Practical Data Pipelines</title><price currency=\"USD\">29.95</price></book><book id=\"bk-102\"><title>XML in Practice</title><price currency=\"USD\">24.50</price></book></catalog>",
  "xmlUrls": [],
  "sources": [
    {
      "name": "August orders",
      "xml": "<erp:orders xmlns:erp=\"urn:sample:erp\"><erp:order id=\"SO-1001\"><erp:customer><erp:name>Northwind Demo</erp:name><erp:region>West</erp:region></erp:customer><erp:total currency=\"USD\">125.4</erp:total></erp:order><erp:order id=\"SO-1002\"><erp:customer><erp:name>Contoso Sample</erp:name><erp:region>East</erp:region></erp:customer><erp:total currency=\"USD\">89</erp:total></erp:order></erp:orders>"
    }
  ],
  "recordPath": "orders.order",
  "maxRows": 1000,
  "removeNamespaces": true,
  "includeAttributes": true,
  "attributePrefix": "@",
  "nestedSeparator": ".",
  "arraySeparator": " | ",
  "columns": [
    "@id",
    "customer.name",
    "customer.region",
    "total.@currency",
    "total.#text"
  ]
}
```

## Output

```json
{
  "_sourceName": {
    "label": "Source",
    "format": "string"
  },
  "_sourceType": {
    "label": "Input type",
    "format": "string"
  },
  "_recordPath": {
    "label": "Record path",
    "format": "string"
  },
  "_recordIndex": {
    "label": "Row",
    "format": "integer"
  },
  "_sourceUrl": {
    "label": "Source URL",
    "format": "string"
  },
  "_error": {
    "label": "Parse error",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [XML to CSV and Excel Converter](https://apify.com/automation-lab/xml-to-csv-excel-converter) with a specific input configuration. Visit the [Actor detail page](https://apify.com/automation-lab/xml-to-csv-excel-converter) to learn more, explore other use cases, and run it yourself.