Serialize model element only if it's not an imported element

Change-Id: Ieed120154a4f75d397cce6fde53ea1968cf32dda
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>