I would add a check here for empty string & also check if the namespace ends with a "." to avoid exception if someone changes the namespace.