Fix escaping of lt/gt characters