Implement write method for namespaces