<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>InfoPath 2010</title><link>https://www.infopathdev.com:443/forums/142.aspx</link><description>Are you exploring new features coming up in 2010? Share information and ask questions here!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Infopath form as xml problem is opened</title><link>https://www.infopathdev.com:443/forums/thread/61123.aspx</link><pubDate>Fri, 05 Nov 2010 19:05:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61123</guid><dc:creator>hmendezm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61123.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=61123</wfw:commentRss><description>&lt;p&gt;I I take the outxml value and create a xml file to attach to the item in a sharepoint list. The code is the following&lt;/p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN;"&gt;&lt;span class="msoIns"&gt;&lt;font color="#008080"&gt;string formXml = MainDataSource.CreateNavigator().OuterXml;&lt;br /&gt;byte[] attachment = Sytem.Text.Encoding.UTF8.GetBytes(formXml);&lt;br /&gt;item.Attachments.Add(&amp;quot;InfoPathForm.xml&amp;quot;, attachment);&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;FONT-SIZE:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN;"&gt;&lt;span class="msoIns"&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;p&gt;The ode works but when I try to open the xml file I get a error screen from formserver. I try to open the file outside sharepoint and I get a error about security. What do I need to do to&amp;nbsp;save the infopath form to xml file using code?&lt;/p&gt;
&lt;p&gt;How I can get the real error because&amp;nbsp;the one that&amp;nbsp;I get is so generic?&lt;/p&gt;
&lt;p&gt;I know this is infopath forum and not Sharepoint but you can think the I what to have the&amp;nbsp;xsn file as xml and be&amp;nbsp; able to open as infopath form&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;Thanks!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>