CREATE OR REPLACE PROCEDURE ListEvents ( p_theVenue VARCHAR2 ) IS
BEGIN
   htp.p('<?xml version="1.0" encoding="utf-8" ?>');
   htp.p('<results>');
   htp.p(' <title>Events at '|| p_theVenue ||' this year.</title>');
   htp.p(' <list>');
   FOR r IN ( SELECT * 
                 FROM Events
                 WHERE venue = "'"|| p_theVenue ||"'" )
   LOOP
      htp.p('  <event>');
      htp.p('   <id>'|| r.eventid ||'</id>');
      htp.p('   <location>'|| r.location ||'</location>');
      htp.p('   <name>'|| r.name ||'</name>');
      htp.p('   <dates>'|| r.dates ||'</dates>');
      htp.p('  </event>');
   END LOOP; 
   htp.p(' </list>');
   htp.p('</results>');
END;
