A WiX product element can not contain an ItemGroup, as the error suggests.
See here for a description of the Product element and it's valid children.
http://wix.sourceforge.net/manual-wix2/wix_xsd_product.htm
Bootstrapper code is normally added to the msbuild file (.csproj file) rather then the wix .wxs file, which I think might be where you placed it - see here for a description of how to do so:
http://wix.sourceforge.net/manual-wix3/install_dotnet.htm
If that doesn't resolve your issue, perhaps add the entire contents of your .wxs and .wxproj files to the question - this should provide enough context to assist people in resolving your issue.