 	
 	// MARK: - Modification Functions
 	
-	/// Adds a resource element to the FCPXML document.
+	/// Adds a resource XMLElement to the FCPXML document.
 	///
 	/// - Parameter resourceElement: The XMLElement of the resource to be added.
 	public func add(resourceElement: XMLElement) {
-		self.fcpxResourceList.addChild(resourceElement)
+		if self.fcpxResourceList == nil {
+			self.rootElement()?.addChild(XMLElement(name: "resources"))
+		}
+		
+		self.fcpxResourceList?.addChild(resourceElement)
+	}
+	
+	
+	/// Adds an array of resource XMLElements to the FCPXML document.
+	///
+	/// - Parameter resourceElements: An array of resource XMLElement instances.
+	public func add(resourceElements: [XMLElement]) {
+		for resource in resourceElements {
+			self.add(resourceElement: resource)
+		}
+	}
+	
+	
+	/// Removes all resources from the FCPXML document.
+	public func removeAllResources() {
+		self.fcpxResourceList?.setChildren(nil)
+	}
+	
+	
+	/// Adds an event to the library XMLElement of the FCPXML document.
+	///
+	/// - Parameter event: The XMLElement of the event to be added.
+	public func add(event: XMLElement) {
+		if self.fcpxLibrary == nil {
+			self.rootElement()?.addChild(XMLElement(name: "library"))
+		}
+		
+		self.fcpxLibrary?.addChild(event)
+	}
+	
+	
+	/// Adds an array of event XMLElements to the FCPXML document.
+	///
+	/// - Parameter events: An array of event XMLElement instances.
+	public func add(events: [XMLElement]) {
+		for event in events {
+			self.add(event: event)
+		}
 	}
 	
 	
 	/// Removes all events from the library.
 	public func removeAllEvents() {
 		for event in self.fcpxEvents {
-			self.fcpxLibrary.removeChild(at: event.index)
+			self.fcpxLibrary?.removeChild(at: event.index)
 		}
 		
 	}

			
			return nil
		}
	}
	
	/// The names of all events as a String array.

	
	// MARK: - Properties

	public var fcpxResourceList: XMLElement? {
		get {
			guard let rootElement = self.rootElement() else {
				return nil
			}
			return rootElement.elements(forName: "resources")[0]
		}
	}
