running 9iR2

I have the following code

Code:
DECLARE
 ctx    dbms_xmlgen.ctxHandle;
 xml    CLOB;
 xmldata	 XMLTYPE;
 emp_no NUMBER := 7369;
 i      PLS_INTEGER;
 str  varchar2(4000) := 'SELECT cntitmprgs_interactions FROM CNTITMPRGS where cntitmprgs_interactions IS NOT NULL '||
                              --  'and dbms_lob.substr(cntitmprgs_interactions, 4000, 1) != ''''<interactions/>'' '||
                               'and cntitmprgs_usrname = ''499941''';

 CURSOR seeXML is
   select extract(xmldata, '/type') datar
   from CNTITMPRGS;							   

BEGIN
  dbms_output.put_line(str);
  ctx := dbms_xmlgen.newContext(str);
  xmldata := dbms_xmlgen.getXMLtype(ctx);
--  dbms_output.put_line(dbms_lob.substr(xml, 255, 1));

  for dtr in seexml loop
    --dbms_output.put_line(to_char(dtr.datar));
	null;
  end loop;
  
  
  
END;
/
I get a "wrong type" error when I uncomment dbms_output. Can any one tell me what I am doing wrong?

Thanks