JPEG is binary data, and XML doesn't support characters in the range 0x00 - 0x1F; Therefore you have to convert the data to another format which XML *can* store.
Base-64 conversion is the most common approach, often it's used for encoding data for email transmission.
So, most scripting languages (PHP, .NET, Perl, Python etc) have the facility built in to convert a string of binary data to Base 64 encoded.
You'll also have to Base-64 decode that data from the XML element when you need it, and send it to the client with the correct image/jpeg and size headers.
Have you considered storing a reference to the image location on the filesystem (as you would when using a database), or are you just doing this as an exercise in pain ?
It's been a year. Hopefully you got an answer to this because I am having the same problem now. Made a custom header on an image program in JPG format (not knowing) my web host wants XSLT format. I've tried everything. I don't know what to do and I'm sorry, but I don't understand what the person who answered the question is saying. I'm quite new at this.