Much more work on xml IO.
Code base is still messy, going to clean it up.