Make XML collector namespace aware.

Passes the XML collector's unit tests.