Using elementtree, how to use < symbole in my text?
04:33 11 May 2026

I'm trying to write an xml file using elementtree.
Inside the text I want to use a chevron, like so

summary = elementTree.SubElement(test_case_xml, "summary")
summary.text = "Some text < "

If I were to print("Some text < ", I would have no issue, but the chevron does seem to be troublesome with element tree changing it to an escaped character (specifically <).
Any idea of how I could manage this ?

from xml.etree import cElementTree as elementTree

et = elementTree.Element("Root")
et.text = "Hellow world ! <"
elementTree.dump(et)

TLDR: How do I write '<' inside the text of an Element of ElementTree ?

python elementtree