Apostrophes are special characters in XML; you need to replace them with the string ' (the same goes for <, >, &, ")
There is a method that does the replacing for you, but I don't remember what it's called or where to look for it; if I find it, I'll {edit|post}.