All metadata are optional, parsers SHOULD provide them and serializers MAY leverage it: metadata is not required to be kept in sync with their data so it's up to the serializers heuristics to use or ignore them.

Namespaces

A namespace aware XML parser produces a datastructure following these representations, this representation is designed as a superset of the clojure.xml representation:

As I'm trying to implement this, I'm having second thoughts about the direction of the mapping: it's important to preverse that one url is mapped to several prefixes but using prefixes as keys makes serialization inconvenient.

So I propose to have a map of uris to sets of prefixes.

A map of urls to stes of prefixes is in the good direction when emitting (and it's the only moment where we care about mapping) while still allowing to check cheaply if a namespace and a uri are mapped together.