Из-за комментария @ J_mie6 я использовал:
private S state;
private D dto;
Предполагалось, что это лучший вариант.
Вы можете просто использовать html.escape()
, чтобы повторно экранировать содержимое:
import html
from xml.etree import ElementTree as ET
tree = ET.parse('test.xml')
root = tree.getroot()
for description in root.iter('Description'):
print(html.escape(description.text))
Результат:
Here are few steps to make these settings
1) Tools << Internet options 2) Click on General tab