I thought I'd post my experience of this having the same issue today.
XML::Parser needs both the includes and the shared libraries of libexpat, but will happily compile even if you dont have the libraries in your path (as long as you have your includes), then give this error when you try and use it.
Make sure you have both the libraries and includes when you build your make file. Include path should contain expat.h, library path should contain libexpat.so
perl Makefile.PL EXPATINCPATH=/usr/sfw/include/ EXPATLIBPATH=/usr/sfw/lib/