title: InfoPath - Cannot open, Form definition (.xsf) contains errors
body: <p>I have somehow managed to break my infopath form :( When I try to open it (both preview mode and design mode) I get the following error:
  InfoPath cannot open the following form D:\infopath\formname.xsn. The form definition (.xsf) file contains errors. </p>
  
  <p>When I click on more details I get this:</p>
  
  <pre><code>The form definition (.xsf) file contains elements, attributes, or structures that are not valid.
  
  Error details:
  The keyref 'ruleSet_5' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}ruleset_name_key'.
  
  Line 232, Position 3
  &lt;/xsf:xDocumentClass&gt;
  --^
  </code></pre>
  
  <p>Is there any way to resolve this? Or is my only option to re-create the form?
  Thanks in advance for any advice!</p>