Implement reading from existing XML

Bugs regarding inconsistent array indexing conventions are (hopefully) fixed.