I've been looking for a way to encode large multi-line strings (basically an entire text file) and put the result in an XML tag to pass to Flex. I'm using php on the server side to serve the xml file to Flex. The text file obviously needs to be encoded to be XML-safe. What do people suggest I use to do this? Are there encode/decode routines for Flex as there are for php? Should I roll my own?