Hi, if you need to get the text in between CasualAdvertiser tag try below code
parser error:
in your file & should be changed in to amp; entity name
then the following code can give the output text

use XML::Twig; my $twig = new XML::Twig( TwigRoots => { 'CasualAdvertiser' => \&outpu +t_title }); $twig->parsefile( shift @ARGV ); sub output_title { ( $tree, $elem) = @_; print $elem->text, "\n\n"; } output: ********** 1580590MERCEDES-BENZE220SPECIAL-EDITION4D SEDAN1994ORV21521500.0000175 +000Almandi neA2.2Air Conditioning, Power Steering, ABS Braking, Powe r Windows, Cruise Control, Towbar, Air Bags, CD Player, Sunroof, Meta lic Paint, Full service historyexcelGaraged, leather trim Must sellAug + 2004VIC - South Eastern 160755104088980110408898011MERCEDES-BENZML320-LUXURY-4x44D WAGON1999AH +V26M42900. 0000123000SilverAUnleadedAir Conditioning, Power Steering, ABS Braking +, Powe r Windows, Cruise Control, Air Bags, CD Player, Central Locking Remot e, Metalic Paint, Roadworthy certificate, Alloy Wheels, Full service historyimmacImmaculate luxury 4wd with all the usual Merc' quality and extras. It's fully serviced & optioned up with the luxury pack plus has quite new tyres all round, long rego, leather interior, woodgrain inserts, CD stacker, traction control, brake assist, Merc' roof rack s etc etc. Extremely well looked after - always garaged and no off ro ad use. Beautiful vehicle in superb condition. Will listen to all rea listic offers.Oct 2005QLD - South Eastern QLD

In reply to Re: Best Way to parse this XML? by perlsen
in thread Best Way to parse this XML? by sirius98

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.