I have tried to parse an XML response that does not work. In the API docs it says that it is a XML based protocol: SRU. Wont this XML parsing code work then? Or is it some error
The dollar sign in $code (in the xpathvar->query) looks like it doesn't belong there. Try either removing or escaping the dollar sign, as appropriate in your case (removing looks appropriate, given the example xml).