diff --git a/pkg/yqlib/doc/usage/xml.md b/pkg/yqlib/doc/usage/xml.md
index fb200381..64a22248 100644
--- a/pkg/yqlib/doc/usage/xml.md
+++ b/pkg/yqlib/doc/usage/xml.md
@@ -192,6 +192,42 @@ cat:
# after cat
```
+## Parse xml: keep attribute namespace
+Given a sample.xml file of:
+```xml
+
+
+
+
+```
+then
+```bash
+yq -p=xml -o=xml --xml-keep-namespace '.' sample.xml
+```
+will output
+```xml
+
+```
+
+## Parse xml: keep raw attribute namespace
+Given a sample.xml file of:
+```xml
+
+
+
+
+```
+then
+```bash
+yq -p=xml -o=xml --xml-keep-namespace --xml-raw-token '.' sample.xml
+```
+will output
+```xml
+
+```
+
## Encode xml: simple
Given a sample.yml file of:
```yaml
diff --git a/pkg/yqlib/xml_test.go b/pkg/yqlib/xml_test.go
index a7967e35..cf7fea5f 100644
--- a/pkg/yqlib/xml_test.go
+++ b/pkg/yqlib/xml_test.go
@@ -153,6 +153,24 @@ var expectedXMLWithComments = `
`
+var inputXMLWithNamespacedAttr = `
+
+
+`
+
+var expectedYAMLWithNamespacedAttr = `map:
+ +xmlns: some-namespace
+ +xmlns:xsi: some-instance
+ +some-instance:schemaLocation: some-url
+`
+
+var expectedYAMLWithRawNamespacedAttr = `map:
+ +xmlns: some-namespace
+ +xmlns:xsi: some-instance
+ +xsi:schemaLocation: some-url
+`
+
var xmlWithCustomDtd = `