Thank you very much. It works fine. I know that it's a beginners mistake. I'm unfortunately not a professional perl programmer. But there is another problem. The structure of the XML document can become complex. A logentry can encapsulate further logentries and so on. So i have to recursively run through all the elements of the XML tree and call the function set_binary(0)? There are different elements within an logentry which could be decoded in Base64. Maybe the easiest way is to set every XML element as none binary. Maybe someone has an idea or solution how to easily achieve this. That would be very kind of you.