Thanks hixxy. I tried that code but it isn't writing anything or creating the xml file now