fix leak in getXMLNodeForKey