fixed up some XML processing