in reply to Getting XML::Simple Module Error

While I find rovf's analysis entirely plausible, /me (admittedly, knowing next to nothing about this topic) wonders about:
<spam-document... at line 2, closed at 22
"<spam ...." ? (emphasis supplied)

Apologies in advance if this is irrelevant, but your error message does mention line 2.