added try catch to fix nasty objects, escaped invalid xml chars