diff --git a/src/Form/IconSetForm.php b/src/Form/IconSetForm.php
index 0a08a0c..55c300e 100644
--- a/src/Form/IconSetForm.php
+++ b/src/Form/IconSetForm.php
@@ -109,6 +109,30 @@ class IconSetForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
+  public function validateForm(array &$form, FormStateInterface $form_state) {
+
+    $source = $form_state->getValue('source');
+
+    // The source field cannot be empty
+    if (empty($source)) {
+      $form_state->setErrorByName('source', $this->t('The source cannot be empty.'));
+    }
+
+    // @See: http://php.net/manual/en/function.libxml-use-internal-errors.php
+    // Using libxml_use_internal_errors we can iterate into the errors generated
+    // by the $source loaded with simplexml_load_string.
+    libxml_use_internal_errors(TRUE);
+    $dom = simplexml_load_string($source);
+    if ($dom === FALSE || libxml_get_errors()) {
+      $form_state->setErrorByName('source', $this->t('The source have to be a valid svg.'));
+    }
+
+  }
+
+
+  /**
+   * {@inheritdoc}
+   */
   public function save(array $form, FormStateInterface $form_state) {
     $icon_set = $this->entity;
     $status = $icon_set->save();
