CreateSyncDeleteRequest() static private method

Builds a Sync delete request by using the specified sync key, folder collection ID, item serverID and deletesAsMoves option. In general, returns the XML formatted Sync request as follows:
static private CreateSyncDeleteRequest ( string collectionId, string syncKey, string serverId ) : SyncRequest
collectionId string Specify the serverId of the folder to be synchronized, which can be returned by ActiveSync FolderSync command(Refer to [MS-ASCMD]2.2.3.30.5)
syncKey string Specify the sync key obtained from the last sync response(Refer to [MS-ASCMD]2.2.3.166.4)
serverId string Specify a unique identifier that was assigned by the server for a mailItem, which can be returned by ActiveSync Sync command
return SyncRequest
        /// <summary>
        /// Delete all the items in a folder.
        /// </summary>
        /// <param name="createdItemsCollection">The collection of items which should be deleted.</param>
        public void DeleteItemsInFolder(Collection <CreatedItems> createdItemsCollection)
        {
            foreach (CreatedItems itemsToFolder in createdItemsCollection)
            {
                SyncStore result = this.SyncChanges(itemsToFolder.CollectionId);

                if (result.AddElements != null)
                {
                    SyncRequest deleteRequest;
                    foreach (SyncItem item in result.AddElements)
                    {
                        if (itemsToFolder.CollectionId == this.CurrentUserInformation.CalendarCollectionId)
                        {
                            foreach (string subject in itemsToFolder.ItemSubject)
                            {
                                if (item.Calendar != null)
                                {
                                    if (item.Calendar.Subject.Equals(subject, StringComparison.CurrentCultureIgnoreCase))
                                    {
                                        deleteRequest = TestSuiteHelper.CreateSyncDeleteRequest(itemsToFolder.CollectionId, result.SyncKey, item.ServerId);
                                        SyncStore deleteResult = this.CALAdapter.Sync(deleteRequest);
                                        Site.Assert.AreEqual <byte>(1, deleteResult.CollectionStatus, "Item should be deleted.");
                                    }
                                }
                            }
                        }

                        if (itemsToFolder.CollectionId == this.CurrentUserInformation.InboxCollectionId || itemsToFolder.CollectionId == this.CurrentUserInformation.DeletedItemsCollectionId || itemsToFolder.CollectionId == this.CurrentUserInformation.SentItemsCollectionId)
                        {
                            foreach (string subject in itemsToFolder.ItemSubject)
                            {
                                if (item.Email != null)
                                {
                                    if (item.Email.Subject.Equals(subject, StringComparison.CurrentCultureIgnoreCase))
                                    {
                                        deleteRequest = TestSuiteHelper.CreateSyncDeleteRequest(itemsToFolder.CollectionId, result.SyncKey, item.ServerId);
                                        SyncStore deleteResult = this.CALAdapter.Sync(deleteRequest);
                                        Site.Assert.AreEqual <byte>(1, deleteResult.CollectionStatus, "Item should be deleted.");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }