Convert characters to HTML entities

Convert all applicable characters to HTML entities to generate valid XML.