The previous comment addressed why your first attempt didn't work. The second one is more subtle. LWP::UserAgent isn't ruining your tags - it's encoding them for transmission to the server on the other end of the connection. You can change the kind of encoding it does, but you shouldn't need to worry about it - the server should decode that back into the original XML.
-sam