private static function parseJoinBlueprint($xml)
 {
     $blueprint = new JoinBlueprint((string) $xml['key']);
     // iterate through blueprints fields, defining them in blueprint object
     foreach ($xml->field as $f) {
         $field = new EntityField((string) $f['key']);
         // common
         $field->setDisplayName((string) $f->displayName);
         $field->setDataType((string) $f->dataType);
         $field->setMimeType((string) $f->mimeType);
         $field->setPrecision((string) $f->precision);
         $encType = (string) $f->encType;
         if (!empty($encType)) {
             $field->setEncType((string) $f->encType);
         }
         $required = (string) $f->required;
         if (strtolower($required) == "true") {
             $field->setRequired(true);
         } else {
             $field->setRequired(false);
         }
         //$field->setMin((string) $f->minimum);
         $minimum = (string) $f->minimum;
         if (!empty($minimum)) {
             $field->setMin($minimum);
         }
         //$field->setMax((string) $f->maximum);
         $maximum = (string) $f->maximum;
         if (!empty($maximum)) {
             $field->setMax($maximum);
         }
         $field->setRegexp((string) $f->regexp);
         $field->setExample((string) $f->example);
         $unique = (string) $f->unique;
         if (strtolower($unique) == "true") {
             $field->setUnique(true);
         } else {
             $field->setUnique(false);
         }
         $field->setForeignKey((string) $f->foreignKey);
         $field->setForeignValue((string) $f->foreignValue);
         if ($field->getDataType() == "enum") {
             $enumOptions = array();
             foreach ($f->enumOptions->option as $option) {
                 $enumOptions[] = (string) $option;
             }
             $field->setEnumOptions($enumOptions);
         }
         $blueprint->add($field);
     }
     return $blueprint;
 }