I put this in the webservice, but I think it can also be in the products.cs public void GenerateXML() { string getPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory); getPath = getPath.Replace("WebSite14", ""); Books t = new Books(); t.SerializeCollection(@"" + getPath + "WebSite1/Books.xml"); }//definitely used