It sounds like you pasted the XML code in as the function of the button instead of pasting it onto the toolbar directly.