Display the formtemplate version on the InfoPath 2007 form

To display the form version on the InfoPath 2007 form add an expression box control to the form. Copy and past the following code in the Xpath box.

substring-before(substring-after(/processing-instruction()[local-name(.) = "mso-infoPathSolution"], 'solutionVersion="'), '"')