PortletDataContextImpl.getImportDataGroupElement() tries to find a given element in the internal data structure _importDataRootElement.
The selector is ".//" + name, which doesn't adhere to xpath specification completely. Thus, not all libraries interpret it correctly. In particular, the one bundled with Liferay doesn't find 'name', returning EMPTY-ELEMENT, which in turn will generate NPE.
It seems that, at some point, using ".//" works, and if it is removed, subsequent errors are created. The solution must, then, preserve the previous behaviour.