' Create user data.
Dim userData As UserData = New UserData("Textual data to export to XML", 99)
' Get annotation to assign user data to.
Dim mark As ImGearARTMark = igARTPage.MarkGet(markId)
' Set corresponding property of the mark.
mark.UserData = userData
' Save page with annotation and user data to a stream.
ImGearART.SavePage(igARTPage, stream, 0, ImGearSavingModes.OVERWRITE, ImGearARTSaveType.XML)
stream.Seek(0, SeekOrigin.Begin)
' Create new ART Page from the stream and get the annotation with the user data.
Dim newArtPage As ImGearARTPage = ImGearART.LoadPage(stream, 0)
Dim newMark As ImGearARTMark = newArtPage.MarkGet(markId)
Dim newUserData As UserData = CType(newMark.UserData, UserData)
System.Diagnostics.Debug.Assert(newUserData.IntegerData = userData.IntegerData)
System.Diagnostics.Debug.Assert(newUserData.TextData = userData.TextData)