Fix some XML parser bugs
Add test program for osm-testdata xml tests