Factored out XML logic from VOTable. Needs testing.