void Write17_CiscoIPPhoneGraphicMenuType(string n, string ns, CiscoIPPhoneGraphicMenuType 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(CiscoIPPhoneGraphicMenuType)) {
         }
         else {
             throw CreateUnknownTypeException(o);
         }
     }
     WriteStartElement(n, ns, o, false, null);
     if (needType) WriteXsiType(@"CiscoIPPhoneGraphicMenuType", @"");
     WriteNullableStringLiteral(@"Title", @"", ((global::System.String)o.@Title));
     WriteNullableStringLiteral(@"Prompt", @"", ((global::System.String)o.@Prompt));
     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)));
     {
         CiscoIPPhoneMenuItemType[] a = (CiscoIPPhoneMenuItemType[])o.@MenuItem;
         if (a != null) {
             for (int ia = 0; ia < a.Length; ia++) {
                 Write2_CiscoIPPhoneMenuItemType(@"MenuItem", @"", ((CiscoIPPhoneMenuItemType)a[ia]), false, false);
             }
         }
     }
     {
         CiscoIPPhoneSoftKeyType[] a = (CiscoIPPhoneSoftKeyType[])o.@SoftKeyItem;
         if (a != null) {
             for (int ia = 0; ia < a.Length; ia++) {
                 Write3_CiscoIPPhoneSoftKeyType(@"SoftKeyItem", @"", ((CiscoIPPhoneSoftKeyType)a[ia]), false, false);
             }
         }
     }
     WriteEndElement(o);
 }