Scratch that, had the wrong code in the file.
Another way to get around all this is to use ocaml-d3:
This will give you a nice (and type-safe) API to make data-driven interfaces, D3.s setups up all the basic xml namespaces for you so you don't have to fight with that.