Try XML::Smart. It handles ASCII contents and binary contents automatically. Soo, if you put some binary data, let's say, and JPEG, as a content of a node, it will be automatically converted to base64. Also it will load and decode automatically base64 contents. Note that this approach is a recomendation of binary handleing at XML.com.
Enjoy! ;-P
Graciliano M. P.
"Creativity is the expression of the liberty".