began toXML for cache, modified shell script