You can get the XML from mysql for free.

mysqldump --xml --compact dbname > out.xml
Or:

UPDATE:

my $db=qq(classicmodels); my $xml= qx(mysqldump --xml --compact $db);
<?xml version="1.0"?> <mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <database name="classicmodels"> <table_structure name="customers"> <field Field="customerNumber" Type="int(11)" Null="NO" Key="PR +I" Extra="" Comment="" /> <field Field="customerName" Type="varchar(50)" Null="NO" Key=" +" Extra="" Comment="" /> <field Field="contactLastName" Type="varchar(50)" Null="NO" Ke +y="" Extra="" Comment="" /> <field Field="contactFirstName" Type="varchar(50)" Null="NO" K +ey="" Extra="" Comment="" /> <field Field="phone" Type="varchar(50)" Null="NO" Key="" Extra +="" Comment="" /> <field Field="addressLine1" Type="varchar(50)" Null="NO" Key=" +" Extra="" Comment="" /> <field Field="addressLine2" Type="varchar(50)" Null="YES" Key= +"" Extra="" Comment="" /> <field Field="city" Type="varchar(50)" Null="NO" Key="" Extra= +"" Comment="" /> <field Field="state" Type="varchar(50)" Null="YES" Key="" Extr +a="" Comment="" /> <field Field="postalCode" Type="varchar(15)" Null="YES" Key="" + Extra="" Comment="" /> <field Field="country" Type="varchar(50)" Null="NO" Key="" Ext +ra="" Comment="" /> <field Field="salesRepEmployeeNumber" Type="int(11)" Null="YES +" Key="" Extra="" Comment="" /> <field Field="creditLimit" Type="double" Null="YES" Key="" Ext +ra="" Comment="" /> <key Table="customers" Non_unique="0" Key_name="PRIMARY" Seq_i +n_index="1" Column_name="customerNumber" Collation="A" Cardinality="1 +22" Null="" Index_type="BTREE" Comment="" Index_comment="" /> <options Name="customers" Engine="MyISAM" Version="10" Row_for +mat="Dynamic" Rows="122" Avg_row_length="114" Data_length="13992" Max +_data_length="281474976710655" Index_length="4096" Data_free="0" Crea +te_time="2012-11-09 09:53:36" Update_time="2012-11-09 09:53:36" Colla +tion="latin1_swedish_ci" Create_options="" Comment="" /> </table_structure> <table_data name="customers"> <row> <field name="customerNumber">103</field> <field name="customerName">Atelier graphique</field> <field name="contactLastName">Schmitt</field> <field name="contactFirstName">Carine </field> <field name="phone">40.32.2555</field> <field name="addressLine1">54, rue Royale</field> <field name="addressLine2" xsi:nil="true" /> <field name="city">Nantes</field> <field name="state" xsi:nil="true" /> <field name="postalCode">44000</field> <field name="country">France</field> <field name="salesRepEmployeeNumber">1370</field> <field name="creditLimit">21000</field> </row> <!-- Skipped the next 20.000 lines... -->

If that is it what you want.

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

In reply to Re: Error when creating a new instance of XML::Writer by karlgoethebier
in thread Error when creating a new instance of XML::Writer by ev0lution

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.