I think you need the code to be inside that CDATA thing, like:
Code:
<phpcode><![CDATA[
// your code
]]></phpcode>
You really should create a new product with the product manager, write your plugins and whatever else you want, then export the product xml rather than doing it the other way around. (Although I believe you need to have a test site in debug mode to be able to do that).