internal static WindowsLiveIdNamespace ParseXml(LiveIdInstanceType liveIdInstanceType, XmlDocument xml)
        {
            WindowsLiveIdNamespace windowsLiveIdNamespace = new WindowsLiveIdNamespace();

            windowsLiveIdNamespace.InstanceType = liveIdInstanceType;
            XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager(xml.NameTable);

            LiveServicesHelper.AddNamespaces(xml, xmlNamespaceManager);
            XmlNode xmlNode = xml.SelectSingleNode("p:Namespace/p:name", xmlNamespaceManager);

            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.Name = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode("p:Namespace/p:ID", xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.propertyBag[SimpleProviderObjectSchema.Identity] = new WindowsLiveIdIdentity(xmlNode.InnerText);
                windowsLiveIdNamespace.ID = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("SiteID"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.SiteID = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("AppID"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.AppID = xmlNode.InnerText;
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("URI"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                Uri uri = null;
                if (Uri.TryCreate(xmlNode.InnerText, UriKind.RelativeOrAbsolute, out uri))
                {
                    windowsLiveIdNamespace.Uri = uri;
                }
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("Certificate"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.Certificate = WindowsLiveIdApplicationCertificate.CertificateFromBase64(xmlNode.InnerText);
            }
            xmlNode = xml.SelectSingleNode(WindowsLiveIdNamespace.GetPropertyXPath("NextCertificate"), xmlNamespaceManager);
            if (xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
            {
                windowsLiveIdNamespace.NextCertificate = WindowsLiveIdApplicationCertificate.CertificateFromBase64(xmlNode.InnerText);
            }
            windowsLiveIdNamespace.RawXml = xml.DocumentElement.InnerXml;
            return(windowsLiveIdNamespace);
        }
 protected override ConfigurableObject ParseResponse(LiveIdInstanceType liveIdInstanceType, XmlDocument xmlResponse)
 {
     return(WindowsLiveIdNamespace.ParseXml(liveIdInstanceType, xmlResponse));
 }