title: How to Create XML output in MySQL procedure query?
body: <p>I am trying to migrate DB2 procedure query to MySQL procedure. This the final converted procedure in MySQL . </p>
  
  <pre><code>CREATE PROCEDURE SAMPLE
     (
     INOUT CLIENT_ID BIGINT,
       OUT CONFIG XML
     )
     BEGIN
     DECLARE CP_ID BIGINT;
     DECLARE CP_NAME VARCHAR(38);
     SET (CP_ID) = (SELECT PROFILE FROM CLIENT WHERE ID=CLIENT_ID LIMIT 1);
     SET (CP_NAME) = (SELECT NAME FROM CLIENT WHERE ID=CP_ID LIMIT 1);
  
          SET CONFIG = (
                     XMLELEMENT(NAME "characteristic",
                     XMLATTRIBUTES('ClientInfo' AS "name"),
                     (
                       XMLELEMENT(NAME "characteristic",
                         XMLATTRIBUTES('ClientProfileData' AS "name"),                   
                        XMLELEMENT(NAME "param", XMLATTRIBUTES('isSupport' AS "name", 'false' AS "value")),
                        XMLELEMENT(NAME "param", XMLATTRIBUTES('profileId' AS "name", CP_ID AS "value"))
                             )
                      )
  
                  )
               );
   END;
  </code></pre>
  
  <p>Here i am trying to output <code>XMl</code> data from the table . I am creating same functionality with <code>XMLELEMENT</code>,<code>XMLATTRIBUTES</code> in <code>DB2</code> . unfortunately i didn't find any alternatives in MySQL . </p>
  
  <p>How can i achieve this same procedure in <code>MySQL</code> ? Any help or suggestions ? </p>