Text content in XML (character data) must escape the <
, and &
characters using pre-defined XML entities. Python code is no exception:
if how_many < 1:
where <
is replaced with <
and &
with &
.
A proper XML parser will return text content un-escaped, replacing such entities with the original characters.