In the XML2 module we have redundant functions: findvalue/findvalues and findnode/findnodes.
the couple's first one returns the first element found while the couple's econd returns a complete array of all element found.
It might be relevant to replace all the findvalue/findnode calls with findvalues[1]/findvalues[1] and thus delete findvalue/findnode.