I installed XML::Mini after trying a different XML checker modules that installed XML:

arser along with 40-50k other perl modules cpan thought it needed...
From the man page for XML::Mini I did this:
Code:
#!/usr/bin/perl -w
use strict;
use XML::Mini::Document;
# Create a new XML::Mini::Document
my $newDoc = XML::Mini::Document->new();
# Creating XML can be done easily by using a hash ref:
my $h = {'user' => {'name' => 'kordaff', 'job' => 'sales flunky'},};
$newDoc->fromHash($h);
# output the XML
open (FILE,">somefile.xml")or die "Miserable: $!\n";
print FILE $newDoc->toString();
That produces somefile.xml with these contents:
Code:
<user>
<name>
kordaff
</name>
<job>
sales flunky
</job>
</user>
Using this example from man XML:

arser to parse that:
Code:
#!/usr/bin/perl -w
use strict;
use XML::Parser;
my $p1 = new XML::Parser(Style => "Debug");
print $p1->parsefile("somefile.xml");
I get this:
Code:
\\ ()
user || #10;
user ||
user \\ ()
user name || #10;
user name || kordaff
user name || #10;
user name ||
user //
user || #10;
user ||
user \\ ()
user job || #10;
user job || sales flunky
user job || #10;
user job ||
user //
user || #10;
user ||
//
And, if I delete the </job> ending tag, that XML:

arser snippet produces this error to die on:
mismatched tag at line 7, column 3, byte 64 at /usr/lib/perl5/site_perl/5.8.7/i686-linux/XML/Parser.pm line 187
Without the Debug parameter, it just spits out that error line for the missing </job> tag.
The man page for XML:

arser goes on to talk about the Subs style (instead of Debug). Subs styles sounds nicely powerful:
'Each time an element starts, a sub by that name in the
package specified by the Pkg option is called with the
same parameters that the Start handler gets called with.
Each time an element ends, a sub with that name appended
with an underscore ("_"), is called with the same
parameters that the End handler gets called with.'
I couldn't actually figure out from the man page for another module I looked at named XML::Checker how you'd check for valid tags with it, but it seemed like it should be possible =)