"Iterating" XML in XSLT (a language designed to manipulate XML) is way less of a pain.
XML has no operators for manipulating or evaluating, it is a metalanguage. XSLT adds this on top of XML to process XML.
It has a place, it can be useful, but I thoroughly detest it.
If you think it's painful and ugly, then don't dig any deeper in computer science than javascript.
"Iterating" XML in XSLT (a language designed to manipulate XML) is way less of a pain.