in reply to Perl LibXML XPATH query issues.
try //@stateId and see what you get
Then ask yourself why you added /@stateId to begin with
Grab a copy of xpather.pl it can tell you xpaths