Here\'s an example of an XML file created in InfoPath:
Thanks for explaining that these are processing instructions. Using CreateProcessingInstruction as suggested, here is the solution:
xmlPi = xmldoc.CreateProcessingInstruction("mso-infoPathSolution", "solutionVersion=\"1.0.0.1\" productVersion=\"12.0.0\" PIVersion=\"1.0.0.0\" href=\"file:///C:\\Metastorm\\Sample%20Procedures\\InfoPath%20samples\\Template1.xsn\" name=\"urn:schemas-microsoft-com:office:infopath:Template1:-myXSD-2010-07-21T14-21-13\"");
xmldoc.AppendChild(xmlPi);