LPS-39587 third attempt

Here we check if there is any array for the current element. For example, if having "liferay.portal.portlet.9.array.0" etc we will have an array and we have to deal with it in a different way as "normal" elements