Code Cleanup, writing of XML network file