Serialize() public method

Serializes current InstrumentDescription object into an XML string
public Serialize ( ) : string
return string
 /**
  * Call this method to save the document data to the database.
  */
 private static void SaveInstrumentDescriptionDocument( InstrumentDescription instrumentDescription,
     Document document,
     BASEBean.eDataState dataState)
 {
     var dbDocument = new dbDocument();
     String xml = instrumentDescription.Serialize();
     document.DocumentContent = dbDocument.documentContent = Encoding.UTF8.GetBytes( xml );
     dbDocument.documentSize = xml.Length;
     document.ContentType = dbDocument.contentType = ATMLContext.CONTEXT_TYPE_XML;
     dbDocument.DataState = dataState;
     if (dataState == BASEBean.eDataState.DS_ADD)
         dbDocument.dateAdded = DateTime.UtcNow;
     else if (dataState == BASEBean.eDataState.DS_EDIT)
         dbDocument.dateUpdated = DateTime.UtcNow;
     document.Description = dbDocument.documentDescription = instrumentDescription.Description;
     dbDocument.documentTypeId = (int) dbDocument.DocumentType.INSTRUMENT_DESCRIPTION;
     document.DocumentType = dbDocument.DocumentType.INSTRUMENT_DESCRIPTION;
     document.version = dbDocument.documentVersion = instrumentDescription.version;
     document.name = dbDocument.documentName = instrumentDescription.Identification.ModelName;
     dbDocument.UUID = Guid.Parse( instrumentDescription.uuid );
     document.uuid = instrumentDescription.uuid;
     dbDocument.save();
 }
        public void EditDocumentObject()
        {
            try
            {
                ControlsToData();
                if (_document.DataState == BASEBean.eDataState.DS_ADD && string.IsNullOrWhiteSpace( edtItem.Text ))
                {
                    if (_document.DocumentType == dbDocument.DocumentType.INSTRUMENT_DESCRIPTION)
                    {
                        var instrument = new InstrumentDescription();
                        instrument.name = edtDocumentName.GetValue<string>();
                        instrument.uuid = edtUUID.GetValue<string>();
                        instrument.Description = edtDescription.GetValue<string>();
                        _document.DocumentContent = Encoding.UTF8.GetBytes( instrument.Serialize() );
                    }
                    edtItem.Text = Encoding.UTF8.GetString( _document.DocumentContent );
                    SaveDocument();
                }

                if (DocumentManager.EditDocument( this, _document, edtUUID.GetValue<string>(),
                                                  Encoding.UTF8.GetString( _document.DocumentContent ), false ))
                {
                    edtItem.Text = _document.Item;
                }
            }
            catch (Exception e)
            {
                ATMLErrorForm.ShowError( e );
            }
        }