void Write24_CiscoIPPhoneStatusType(string n, string ns, CiscoIPPhoneStatusType 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(CiscoIPPhoneStatusType)) {
         }
         else {
             throw CreateUnknownTypeException(o);
         }
     }
     WriteStartElement(n, ns, o, false, null);
     if (needType) WriteXsiType(@"CiscoIPPhoneStatusType", @"");
     WriteNullableStringLiteral(@"Text", @"", ((global::System.String)o.@Text));
     if (o.@TimerSpecified) {
         WriteElementStringRaw(@"Timer", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Timer)));
     }
     if (o.@LocationXSpecified) {
         WriteElementStringRaw(@"LocationX", @"", System.Xml.XmlConvert.ToString((global::System.Int16)((global::System.Int16)o.@LocationX)));
     }
     if (o.@LocationYSpecified) {
         WriteElementStringRaw(@"LocationY", @"", System.Xml.XmlConvert.ToString((global::System.Int16)((global::System.Int16)o.@LocationY)));
     }
     WriteElementStringRaw(@"Width", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Width)));
     WriteElementStringRaw(@"Height", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Height)));
     WriteElementStringRaw(@"Depth", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Depth)));
     WriteElementStringRaw(@"Data", @"", FromByteArrayHex(((global::System.Byte[])o.@Data)));
     WriteEndElement(o);
 }
 CiscoIPPhoneStatusType Read24_CiscoIPPhoneStatusType(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)id25_CiscoIPPhoneStatusType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
     }
     else
         throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
     }
     if (isNull) return null;
     CiscoIPPhoneStatusType o;
     o = new CiscoIPPhoneStatusType();
     bool[] paramsRead = new bool[8];
     while (Reader.MoveToNextAttribute()) {
         if (!IsXmlnsAttribute(Reader.Name)) {
             UnknownNode((object)o);
         }
     }
     Reader.MoveToElement();
     if (Reader.IsEmptyElement) {
         Reader.Skip();
         return o;
     }
     Reader.ReadStartElement();
     Reader.MoveToContent();
     int whileIterations0 = 0;
     int readerCount0 = 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)id26_Text && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 if (ReadNull()) {
                     o.@Text = null;
                 }
                 else {
                     o.@Text = Reader.ReadElementString();
                 }
                 paramsRead[0] = true;
             }
             else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id27_Timer && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 o.@TimerSpecified = true;
                 {
                     o.@Timer = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString());
                 }
                 paramsRead[1] = true;
             }
             else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id28_LocationX && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 o.@LocationXSpecified = true;
                 {
                     o.@LocationX = System.Xml.XmlConvert.ToInt16(Reader.ReadElementString());
                 }
                 paramsRead[2] = true;
             }
             else if (!paramsRead[3] && ((object) Reader.LocalName == (object)id29_LocationY && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 o.@LocationYSpecified = true;
                 {
                     o.@LocationY = System.Xml.XmlConvert.ToInt16(Reader.ReadElementString());
                 }
                 paramsRead[3] = true;
             }
             else if (!paramsRead[4] && ((object) Reader.LocalName == (object)id30_Width && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 {
                     o.@Width = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString());
                 }
                 paramsRead[4] = true;
             }
             else if (!paramsRead[5] && ((object) Reader.LocalName == (object)id31_Height && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 {
                     o.@Height = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString());
                 }
                 paramsRead[5] = true;
             }
             else if (!paramsRead[6] && ((object) Reader.LocalName == (object)id32_Depth && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 {
                     o.@Depth = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString());
                 }
                 paramsRead[6] = true;
             }
             else if (!paramsRead[7] && ((object) Reader.LocalName == (object)id33_Data && (object) Reader.NamespaceURI == (object)id2_Item)) {
                 {
                     o.@Data = ToByteArrayHex(false);
                 }
                 paramsRead[7] = true;
             }
             else {
                 UnknownNode((object)o, @":Text, :Timer, :LocationX, :LocationY, :Width, :Height, :Depth, :Data");
             }
         }
         else {
             UnknownNode((object)o, @":Text, :Timer, :LocationX, :LocationY, :Width, :Height, :Depth, :Data");
         }
         Reader.MoveToContent();
         CheckReaderCount(ref whileIterations0, ref readerCount0);
     }
     ReadEndElement();
     return o;
 }