 			
 			return nil
 		}
+		
+		set (value){
+			
+			if value != nil {
+				let version = XMLNode.attribute(withName: "version", stringValue: String(value!)) // TODO: This is a good model for initializing XMLElements of different types
+				self.rootElement()?.addAttribute(version as! XMLNode)
+			} else {
+				self.rootElement()?.removeAttribute(forName: "version")
+			}
+		}
 	}
 	
 	/// The names of all events as a String array.

	
	// MARK: - Properties

	public var fcpxResourceList: XMLElement {
		get {
			let rootElement = self.child(at: 0) as! XMLElement
			return rootElement.elements(forName: "resources")[0]
		}
	}

	}
	
	
	/// Initializes a new XMLDocument as FCPXML.
	///
	/// - Parameters:
	///   - resources: Resources an array of XMLElement instances
	///   - events: Events as an array of XMLElement instances
	///   - fcpxmlVersion: The FCPXML version of the document to use.
	public convenience init(resources: [XMLElement], events: [XMLElement], fcpxmlVersion: Float) {
		
		self.init()
		self.documentContentKind = XMLDocument.ContentKind.xml
		self.characterEncoding = "UTF-8"
		self.version = "1.0"
		
		self.dtd = XMLDTD()
		self.dtd!.name = "fcpxml"
		self.isStandalone = false
		
		self.setRootElement(XMLElement(name: "fcpxml"))
		self.fcpxmlVersion = 1.6
		
		self.add(resourceElements: resources)
		self.add(events: events)
		
	}

	
	// MARK: - Parsing Functions
