Add XML generation functionality to exports

A first stab at #477. The produced XML is not good, and doesn't meet
the State Decoded XML standard, but it's a start.