Java one-liner: XML text escapes
It never occured to me before today but
str.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">");
is good enough for quick and dirty escaping of XML text.
And escaping it manually to write it here is also fun ;-)