Forgot the error:
System.Security.SecurityException
Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Xml.XmlDocument.Save(String filename)
at addresssort.addresssort.GetHDData(ArrayList xArrHD) in c:\documents and settings\alex\my documents\visual studio projects\addresssort\formcode.cs:line 108
at addresssort.addresssort.GetSortedHD(Int32 xlngSortOrder) in c:\documents and settings\alex\my documents\visual studio projects\addresssort\formcode.cs:line 89
at addresssort.addresssort.btnSort_OnClick(DocActionEvent e) in c:\documents and settings\alex\my documents\visual studio projects\addresssort\formcode.cs:line 46
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)