extracting scripts to external xml files