void Write22_CiscoIPhoneResponseType(string n, string ns, CiscoIPhoneResponseType 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(CiscoIPhoneResponseType)) {
         }
         else {
             throw CreateUnknownTypeException(o);
         }
     }
     WriteStartElement(n, ns, o, false, null);
     if (needType) WriteXsiType(@"CiscoIPhoneResponseType", @"");
     {
         CiscoIPPhoneResponseItemType[] a = (CiscoIPPhoneResponseItemType[])o.@ResponseItem;
         if (a != null) {
             for (int ia = 0; ia < a.Length; ia++) {
                 Write5_CiscoIPPhoneResponseItemType(@"ResponseItem", @"", ((CiscoIPPhoneResponseItemType)a[ia]), false, false);
             }
         }
     }
     WriteEndElement(o);
 }
 CiscoIPhoneResponseType Read22_CiscoIPhoneResponseType(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)id35_CiscoIPhoneResponseType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
     }
     else
         throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
     }
     if (isNull) return null;
     CiscoIPhoneResponseType o;
     o = new CiscoIPhoneResponseType();
     CiscoIPPhoneResponseItemType[] a_0 = null;
     int ca_0 = 0;
     bool[] paramsRead = new bool[1];
     while (Reader.MoveToNextAttribute()) {
         if (!IsXmlnsAttribute(Reader.Name)) {
             UnknownNode((object)o);
         }
     }
     Reader.MoveToElement();
     if (Reader.IsEmptyElement) {
         Reader.Skip();
         o.@ResponseItem = (CiscoIPPhoneResponseItemType[])ShrinkArray(a_0, ca_0, typeof(CiscoIPPhoneResponseItemType), true);
         return o;
     }
     Reader.ReadStartElement();
     Reader.MoveToContent();
     int whileIterations2 = 0;
     int readerCount2 = ReaderCount;
     while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
         if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
             if (((object) Reader.LocalName == (object)id36_ResponseItem && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 a_0 = (CiscoIPPhoneResponseItemType[])EnsureArrayIndex(a_0, ca_0, typeof(CiscoIPPhoneResponseItemType));a_0[ca_0++] = Read5_CiscoIPPhoneResponseItemType(false, true);
             }
             else {
                 UnknownNode((object)o, @":ResponseItem");
             }
         }
         else {
             UnknownNode((object)o, @":ResponseItem");
         }
         Reader.MoveToContent();
         CheckReaderCount(ref whileIterations2, ref readerCount2);
     }
     o.@ResponseItem = (CiscoIPPhoneResponseItemType[])ShrinkArray(a_0, ca_0, typeof(CiscoIPPhoneResponseItemType), true);
     ReadEndElement();
     return o;
 }