pub.xml:getNextXMLNode throws NullPointer Exception

I have an incoming xml which I am processing node by node using NodeIterator. However the service pub.xml:getNextXMLNode which is invoked to retrieve the next node throws a Null Pointer exception.

<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" xmlns:xsi="">

Here, is the root tag in the xml, and I am trying to parse a field that is child of the tag by passing appropriate value in the criteria parameter of pub.xml:getXMLNodeIterator service.

The error is thorwn due to the presence of the xmlns declaration.

By the way, converting the xml directly using pub.xml:xmlNodeToDocument does not throw any error.

Can anyone throw some light on why this issue happens and how it can be resolved.
Thanks in Advance,