@Override
	public ResourceDefinition create(DataNode node) throws ResourceException {

		validator.validate(node);

		String type = node.getAttribute("type");
		String id = node.getAttribute("id");
		
		ResourceDefinition definition = new BasicResourceDefinition(id, type);
		for (Entry<String, String> entry : node.getAttributes().entrySet()) {

			String key = entry.getKey();
			String value = entry.getValue();

			if (!key.equals("id") && !key.equals("type")
					&& !key.equals("deferred")) {
				definition.addAttribute(key, value);
			}
		}
		
		if (node.getNumberOfChildren() == 0) {
			definition.setValue(node.getContent().trim());
		}

		return definition;
	}