tidy code in KmlToXml