If you are using Visual Studio 2003, download the Infopath 2003 Toolkit for Visual Studio .NET from the link on the left of this page. If you are using Visual Studio 2005, you will have to download the toolkit from an MSDN subscription or order the CD media from Microsoft. Once you have the toolkit installed, open Visual Studio and choose New Project -> InfoPath Form template under the C# folder.
For saving XML files locally this is trivial and can be done by choose File -> Save As.. -> browse to local folder.
Once the XML is in the file run your stored procedure.
Good luck!
---------------
Matt Faus
InfoPath Dev Texas
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge