Hi everyone,
I solved the problem thanks to the following blogpost: http://www.sharepointblogs.be/blogs/vandest/archive/2013/10/25/infopath-forms-services-and-the-xsinil-in-code-behind.aspx
One more issue with attr.Value = BoolHelper.True; => described and solved here: http://gordonduthie.net/2012/10/01/assigning-boolean-value-to-infopath-data-source-element/
Best regards
Daniel