void Write3_CiscoIPPhoneSoftKeyType(string n, string ns, CiscoIPPhoneSoftKeyType o, bool isNullable, bool needType) {
     if ((object)o == null) {
         if (isNullable) WriteNullTagLiteral(n, ns);
         return;
     }
     if (!needType) {
         System.Type t = o.GetType();
         if (t == typeof(CiscoIPPhoneSoftKeyType)) {
         }
         else {
             throw CreateUnknownTypeException(o);
         }
     }
     WriteStartElement(n, ns, o, false, null);
     if (needType) WriteXsiType(@"CiscoIPPhoneSoftKeyType", @"");
     WriteNullableStringLiteral(@"Name", @"", ((global::System.String)o.@Name));
     WriteNullableStringLiteral(@"URL", @"", ((global::System.String)o.@URL));
     if (o.@PostionSpecified) {
         WriteElementStringRaw(@"Position", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Postion)));
     }
     WriteNullableStringLiteral(@"URLDown", @"", ((global::System.String)o.@URLDown));
     WriteEndElement(o);
 }
 CiscoIPPhoneSoftKeyType Read3_CiscoIPPhoneSoftKeyType(bool isNullable, bool checkType) {
     System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
     bool isNull = false;
     if (isNullable) isNull = ReadNull();
     if (checkType) {
     if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id12_CiscoIPPhoneSoftKeyType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
     }
     else
         throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
     }
     if (isNull) return null;
     CiscoIPPhoneSoftKeyType o;
     o = new CiscoIPPhoneSoftKeyType();
     bool[] paramsRead = new bool[4];
     while (Reader.MoveToNextAttribute()) {
         if (!IsXmlnsAttribute(Reader.Name)) {
             UnknownNode((object)o);
         }
     }
     Reader.MoveToElement();
     if (Reader.IsEmptyElement) {
         Reader.Skip();
         return o;
     }
     Reader.ReadStartElement();
     Reader.MoveToContent();
     int whileIterations7 = 0;
     int readerCount7 = ReaderCount;
     while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
         if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
             if (!paramsRead[0] && ((object) Reader.LocalName == (object)id46_Name && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 if (ReadNull()) {
                     o.@Name = null;
                 }
                 else {
                     o.@Name = Reader.ReadElementString();
                 }
                 paramsRead[0] = true;
             }
             else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id38_URL && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 if (ReadNull()) {
                     o.@URL = null;
                 }
                 else {
                     o.@URL = Reader.ReadElementString();
                 }
                 paramsRead[1] = true;
             }
             else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id47_Postion && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 o.@PostionSpecified = true;
                 {
                     o.@Postion = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString());
                 }
                 paramsRead[2] = true;
             }
             else if (!paramsRead[3] && ((object) Reader.LocalName == (object)id48_URLDown && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 if (ReadNull()) {
                     o.@URLDown = null;
                 }
                 else {
                     o.@URLDown = Reader.ReadElementString();
                 }
                 paramsRead[3] = true;
             }
             else {
                 UnknownNode((object)o, @":Name, :URL, :Postion, :URLDown");
             }
         }
         else {
             UnknownNode((object)o, @":Name, :URL, :Postion, :URLDown");
         }
         Reader.MoveToContent();
         CheckReaderCount(ref whileIterations7, ref readerCount7);
     }
     ReadEndElement();
     return o;
 }