Sending image in XML using C#


  • On the sender side, start with your image as a byte[].
  • Convert the array to a text representation (a base64 string) using Convert.ToBase64String(array).
  • Put that base64 string into the XML.
  • On the receiver side, simply decode the base64 back to byte[] using Convert.FromBase64String(string).

For details on each of those operations check this other post.