JDOM is fully namespace aware
A namespace URL (which may be the empty string) is attached to each element and attribute.
Additional namespace declarations (beyond the element's own namespace) can be attached to any element:
public void addNamespaceDeclaration(Namespace additionalNamespace)
If you need to know what URI is mapped to a given prefix or what the default namespace is, you ask the nearest ancestor-or-self element:
public Namespace getNamespace(String prefix)
The Namespace
class uses the flyweight design pattern
so that multiple elements in the same namespace don't eat huge amounts of memory.
Serialization puts namespace declarations in the right places.