Fix escaping of special characters

Fix escaping of special characters like '"' and '>' for node texts.