create or replace type tp as object( nome varchar(20), map member function oi return varchar, member procedure print ); create or replace type body tp as map member function oi return varchar is begin return nome; end; member procedure print is begin dbms_output.put_line('oi'); end print; end; create table abda of tp( nome not null); insert into abda values ('oi'); select p.oi() from abda p; set serveroutput on; declare var_contexto dbms_xmlgen.ctxhandle; resultado clob; begin var_contexto := dbms_xmlgen.newcontext('select * from tb_cliente'); dbms_xmlgen.setrowtag(var_contexto, 'ASSINANTE'); resultado := dbms_xmlgen.getxml(var_contexto); dbms_output.put_line(resultado); dbms_xmlgen.closecontext(var_contexto); end; declare bsa tp; begin bsa.print;