Updated TreeBuilder for namespaces.