The thing with the module I am making is that it kind of generates a javascript snippet, so I cannot use an action to just hook that into the section of the HTML since the
Alan Storm's solution works but you might want to include your script or html data in a template file to keep it separate from the XML.