In one embodiment, at least a portion of an object model having at least
one namespace is serialized. An ancestor namespace is searched for based
on a current namespace declaration. The ancestor namespace is associated
with an ancestor prefix and an ancestor uniform resource indicator (URI).
The current namespace is associated with a current prefix and current
URI. The search is performed to find an ancestor prefix matches the
current prefix. When the current namespace is an implicit no default
namespace and the ancestor namespace is an explicit default namespace
based on, at least in part, the ancestor prefix, a serialized namespace
declaration is generated for the current namespace.