private XNamespace GetXmlNamespace(IDictionary <string, XNamespace> namespaces, Type type) { var ns = reflection.GetNamespaceForXml(type); XNamespace xmlNs; if (namespaces.TryGetValue(ns, out xmlNs) == false) { namespaces[ns] = xmlNs = reflection.GetAssemblyQualifiedNameWithoutVersion(type); } return(xmlNs); }