diff --git a/plugins/relation.inc b/plugins/relation.inc
new file mode 100644
index 0000000..00e406b
--- /dev/null
+++ b/plugins/relation.inc
@@ -0,0 +1,163 @@
+<?php
+/**
+ * @file
+ * Is an alter plugin for defaultcontent
+ *
+ * Handles the exporting and importing of relation fields
+ */
+
+$plugin = array();
+
+/**
+ * Handles the change to the node need for exporting node references
+ *
+ * Change the node_ref field to refer to the machine_name of the
+ * references nodes
+ *  'field_album' => array(
+ *    'und' => array(
+ *      0 => array(
+ *        'relation_id' => '92',
+ *        'endpoints' => array(
+ *          1 => 'node:11',
+ *        ),
+ *      ),
+ *      'entity_id' => 108,
+ *    ),
+ *  ),
+ */
+function relation_export_alter(&$node) {
+
+  // @todo The export alter is called twice for every node
+  // when enabling a feature with the demo content. After a node is processed
+  // it will add an array to the field's endpoints, which will then casue
+  // an error when exploding the (node:12) string whcih we need to do to get
+  // the machine name into the export.
+  if (!(is_array($node->field_album['und'][0]['endpoints'][1]))) {
+
+    // Get all fields that are relations.
+    $fields = get_relation_fields();
+
+    // Loop through all fields.
+    foreach ($fields as $field_name => $field) {
+      // Check for whether the field is set.
+      if (isset($node->{$field_name})) {
+
+        foreach ($node->{$field_name} as $lang => $items) {
+          foreach ($items as $key => $item) {
+            $relations = array();
+
+            // Check to make sure this node has endpoints that will be reset.
+            if (isset($item['endpoints'])) {
+              foreach ($item['endpoints'] as $epkey => $epvalue) {
+                // Pull the type of the node and the node id.
+                list($entity, $nid) = explode(":", $epvalue);
+                // Grab the machine name of the node that the relation points
+                // to, based on the nid.
+                if ($machine_name = defaultcontent_get_default($nid)) {
+                  // Reset the nid with a reference to the machine name
+                  // of the node.
+                  $node->{$field_name}[$lang][$key]['endpoints'][$epkey] = array("machine_name" => $machine_name);
+                }
+                else {
+                  // Do we need this check? Most likely not.
+                  unset($node->{$field_name}[$lang][$key]);
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+/**
+ * Implements hook_import_alter().
+ *
+ * Relationship select fields are just dummy fields, but we can use them to
+ * look for the relationship.
+ */
+function relation_import_alter(&$node) {
+
+  // @todo we could make this handle more than one set of endpoints.
+  // Right now we only have one set of endpoints so using array key 1.
+  if (isset($node->field_album['und'][0]['endpoints'][1]['machine_name'])) {
+
+    $album_machine = $node->field_album['und'][0]['endpoints'][1]['machine_name'];
+    $album_nid = defaultcontent_get_default($album_machine);
+    // We unset this becasue it is just a dummy field.
+    unset($node->field_album);
+
+    // Create a placeholder track node.
+    $track = new stdClass();
+    $track->type = 'track';
+    // For some reason title didn't get overwritten, so we had to set it here.
+    $track->title = $node->title;
+    node_object_prepare($track);
+    node_save($track);
+    // Assign the temporary nid to the node being imported. The imported node
+    // values should resaved over the placeholder node.
+    $node->nid = $track->nid;
+
+    $endpoints = array(
+      array('entity_type' => 'node', 'entity_id' => $track->nid),
+      array('entity_type' => 'node', 'entity_id' => $album_nid),
+    );
+
+    // Create a relation object based on the two endpoints.
+    $relation = relation_create('is_on', $endpoints);
+    // Save the relationship. This has the effect of creating the dummy field.
+    relation_save($relation);
+
+  }
+
+}
+
+/**
+ * Handles a sort to insure that ref nodes are import first
+ */
+function relation_import_sort($a, $b) {
+  $fields = get_relation_fields();
+  $a_children = array();
+  $b_children = array();
+
+  foreach ($fields as $field_name => $field) {
+    if (isset($a->{$field_name})) {
+      foreach ($a->{$field_name} as $lang => $items) {
+        foreach ($items as $key => $item) {
+          $a_children[] = $item['endpoints'];
+        }
+      }
+    }
+    if (isset($b->{$field_name})) {
+      foreach ($b->{$field_name} as $lang => $items) {
+        foreach ($items as $key => $item) {
+          $b_children[] = $item['endpoints'];
+        }
+      }
+    }
+  }
+  if (in_array($a->machine_name, $b_children) || empty($a_children)) {
+    return -1;
+  }
+  elseif (in_array($b->machine_name, $a_children) || empty($b_children)) {
+    return 1;
+  }
+  else {
+    return 0;
+  }
+}
+
+/**
+ * Helper function to get all node reference fields
+ */
+function get_relation_fields() {
+  $relation_fields = array();
+  foreach (field_info_fields() as $id => $field) {
+
+    if ($field['type'] == 'relation') {
+      $relation_fields[$id] = $field;
+    }
+  }
+  return $relation_fields;
+}
