Needs["XML`"] XML with explicit namespace information: ToCompactXML suppresses redundant namespace information for elements. Attributes in the null namespace always get compacted, regardless of the setting of "AttributesDefaultNameSpace":
| Out[3]= |  |
| Out[4]= |  |
Attributes in the same default namespace as the element only get compacted when "AttributesDefaultNameSpace" is "ElementNameSpace".
| Out[5]= |  |
| Out[6]= |  |
Attributes in other namespaces do not get compacted:
| Out[7]= |  |
| Out[8]= |  |
If the namespace of a tag is explicit but different from the default, attributes will not be compacted:
| Out[9]= |  |
The default namespace may be inherited from containing tags:
| Out[10]= |  |
|