Use XML Entity Encoder / Decoder without a complicated workflow.
Encode XML-sensitive characters and decode XML entities back into readable text. This registration is prepared for a browser-side JavaScript UI, so no Python/API processing is required when the UI is implemented.