XML/XQuery/preserve
Query with preserve, no-inherit
<source lang="xml">
File: Data.xml
<cat:order xmlns:cat="http://wbex.ru/cat"
xmlns:prod="http://wbex.ru/prod" xmlns:ord="http://wbex.ru/ord"> <prod:car> <prod:id>0002</prod:id> <prod:name language="en">name 2</prod:name> </prod:car>
</cat:order> File: Query.xquery
declare copy-namespaces preserve, no-inherit; <report xmlns="http://wbex.ru/report"
xmlns:cat="http://wbex.ru/cat" xmlns:prodnew="http://wbex.ru/prod"> { doc("Data.xml")//prodnew:car
} </report>
Output: <?xml version="1.0" encoding="UTF-8"?> <report xmlns:prodnew="http://wbex.ru/prod" xmlns:cat="http://wbex.ru/cat"
xmlns="http://wbex.ru/report"> <prod:car xmlns:prod="http://wbex.ru/prod" xmlns:ord="http://wbex.ru/ord" xmlns=""> <prod:id>0002</prod:id> <prod:name language="en">name 2</prod:name> </prod:car>
</report>
</source>