Added trim to elements as per JIRA Islandora-778

Added trim to element for 6.x as per JIRA Islandora-778