improved clean_xml util, renamed opts to config