this is a simple perl script written using XML::DOM (which I think is standard now). its makes a text summary of geocaching.com .gpx files. You should be able to figure out which fields are which by the tag names. the html_simple sub is not ideal for all html but seems to work fine for gpx long and short descriptions.
---SCAL
============================================
#!/usr/bin/perl -w
# Matthew Ketterling 2005
# mattk470 at hotmail dot com
# free to use and edit when proper credit is given.
use strict;
use warnings;
use XML::DOM;
my $file = 'c:\perl\infile.gpx'; # .gpx file location and name
my $outputfile = 'c:\perl\outfile.txt'; #.txt output file location and name
my $parser = XML::DOM::Parser->new();
my $gpx = $parser->parsefile($file);
open (OUT, ">".$outputfile) || die "Could not open $outputfile";
my $srtdesc; my $lngdesc;
# parses XML file
foreach my $waypoint ($gpx->getElementsByTagName('wpt'))
{
print OUT "-",$waypoint->getElementsByTagName('name')-> item(0) -> getFirstChild->getNodeValue," ";
print OUT $waypoint -> getAttribute('lat')," ";
print OUT $waypoint -> getAttribute('lon'),"\n";
print OUT $waypoint->getElementsByTagName('Groundspeak:name')-> item(0) -> getFirstChild->getNodeValue," by the ";
print OUT $waypoint->getElementsByTagName('Groundspeak:owner')-> item(0) -> getFirstChild->getNodeValue,"\n";
print OUT $waypoint->getElementsByTagName('Groundspeak:container')-> item(0) -> getFirstChild->getNodeValue," ";
print OUT $waypoint->getElementsByTagName('Groundspeak:type')-> item(0) -> getFirstChild->getNodeValue," \(";
print OUT "D:",$waypoint->getElementsByTagName('Groundspeak:difficulty')-> item(0) -> getFirstChild->getNodeValue,"\/";
print OUT "T:",$waypoint->getElementsByTagName('Groundspeak:terrain')-> item(0) -> getFirstChild->getNodeValue,"\)\n";
print OUT "SD= ",$srtdesc = gpx_remhtml_smpl($waypoint->getElementsByTagName('Groundspeak:short_description')-> item(0) -> getFirstChild->getNodeValue),"\n";
print OUT "LD= ",$lngdesc = gpx_remhtml_smpl($waypoint->getElementsByTagName('Groundspeak:long_description')-> item(0) -> getFirstChild->getNodeValue),"\n";
print OUT "HINT= ",$waypoint->getElementsByTagName('Groundspeak:encoded_hints')-> item(0) -> getFirstChild->getNodeValue,"\n";
print OUT "\n";
}
close (OUT);
exit(0);
sub gpx_remhtml_smpl
{
my ($text) = @_;
($text = $text) =~ s/<[^>]*>//gs;
$text =~ s/\r/\n/gs;
$text =~ s/\n/ /gs;
while ($text =~ m/ /gs)
{
$text =~ s/ / /gs;
}
$text =~ s/ //gs;
return $text;
}