It works!

I gave in and used an XML parser, as I've now learned about modules. It was suprisingly easy because it magically worked and I still don't really know why.