Added trim to elements as per JIRA Islandora-778

Added trim to elements as per JIRA Islandora-778