Getting XML Data from query

declare
QRY_HANDLE_INFO DBMS_XMLGEN.CTXHANDLE;
V_ORDER_DETAILS_QUERY varchar2(100);
v_xml_result CLOB;

begin
V_ORDER_DETAILS_QUERY:=’select sysdate from dual’;
— DBMS_XMLGEN.SETROWSETTAG(QRY_HANDLE_INFO, ‘Headers’);
— DBMS_XMLGEN.setRowTag(qry_handle_info, ‘Header’);
QRY_HANDLE_INFO:=DBMS_XMLGEN.NEWCONTEXT(V_ORDER_DETAILS_QUERY);
V_XML_RESULT:=DBMS_XMLGEN.GETXML(QRY_HANDLE_INFO);
v_xml_result := REPLACE( v_xml_result
, ‘<?xml version=”1.0″?>’
, ‘<?xml version=”1.0″ encoding=”ISO-8859-1″ ?>’ );
DBMS_OUTPUT.PUT_LINE(V_XML_RESULT);
DBMS_XMLGEN.closeContext (qry_handle_info);
end;