<?xml version="1.0" encoding="windows-1252"?>
<node id="1020072" title="Re: Nested data with XML::Simple" created="2013-02-22 00:47:57" updated="2013-02-22 00:47:57">
<type id="11">
note</type>
<author id="1016711">
manorhce</author>
<data>
<field name="doctext">
&lt;p&gt; Hi Please try this and it will help you and please try to print the data accordingly from the complex data XML::Simple will pass the xml data and will create a nested data structure and you can bring your data from that&lt;/p&gt;

&lt;code&gt;
#!/usr/bin/perl

use XML::Simple;

local $/ = undef;
$xml_data = &lt;DATA&gt;;

    $xml_simple = XML::Simple-&gt;new( KeepRoot =&gt; 1,
                                     KeyAttr =&gt; 1,
                                  ForceArray =&gt; 1
                                  );
$xml_obj_data = $xml_simple-&gt;XMLin($xml_data);

use Data::Dumper;

print Dumper($xml_obj_data);

__DATA__ 
&lt;OrderDetail&gt;
       &lt;ListOfItemDetail&gt;
           &lt;ItemDetail&gt;
               &lt;BuyerLineItemNum&gt;1&lt;/BuyerLineItemNum&gt;
               &lt;ListOfStructuredNote&gt;
                   &lt;StructuredNote&gt;
                       &lt;GeneralNote&gt;Line 1 Text.&lt;/GeneralNote&gt;
                   &lt;/StructuredNote&gt;
               &lt;/ListOfStructuredNote&gt;
           &lt;/ItemDetail&gt;
           &lt;ItemDetail&gt;
               &lt;BuyerLineItemNum&gt;2&lt;/BuyerLineItemNum&gt;
               &lt;ListOfStructuredNote&gt;
                   &lt;StructuredNote&gt;
                       &lt;GeneralNote&gt;Line 2 Text.&lt;/GeneralNote&gt;
                   &lt;/StructuredNote&gt;
               &lt;/ListOfStructuredNote&gt;
               &lt;ListOfStructuredNote&gt;
                   &lt;StructuredNote&gt;
                       &lt;GeneralNote&gt;More Line 2 Text.&lt;/GeneralNote&gt;
                   &lt;/StructuredNote&gt;
               &lt;/ListOfStructuredNote&gt;
           &lt;/ItemDetail&gt;
       &lt;/ListOfItemDetail&gt;
&lt;/OrderDetail&gt;
&lt;/code&gt;</field>
<field name="root_node">
1020037</field>
<field name="parent_node">
1020037</field>
</data>
</node>
