     mediaType.name = "media-type"
     mediaType.stringValue = "application/oebps-package+xml"
     rootfile.addAttribute(mediaType)
-
-
+    
+    
     rootfiles.addChild(rootfile)
     container.addChild(rootfiles)
-
+    
     root.version = "1.0"
     root.isStandalone = true
-
+    
     return root.xmlData(withOptions: Int(XMLNode.Options.nodePrettyPrint.rawValue))
 }
 
-func packageXMLData() -> Data {
+func packageXMLData(withFileList fileList: Array<String>) -> Data {
     let package = XMLElement(name: "package")
     let root = XMLDocument(rootElement: package)
     root.version = "1.0"

    version.stringValue = "1.0"
    version.kind
    package.addAttribute(version)

    let metadata = XMLElement(name: "metadata")
    let title = XMLElement(name: "dc:title", stringValue: "dod")
    let creator = XMLElement(name: "dc:creator", stringValue: "Richard Fabian")
    metadata.addChild(title)
    metadata.addChild(creator)

    package.addChild(metadata)

    let namespace = XMLElement(kind: .namespace)
    namespace.name = ""
    namespace.stringValue = "http://www.idpf.org/2007/opf"
    package.addNamespace(namespace)

    let manifest = XMLElement(name: "manifest")

    func manifestItem(withName name: String, index: Int) -> XMLElement {
        let item = XMLElement(name: "item")
        if name.hasSuffix("png") {
            item.setAttributesAs(["href": "images/\(name)", "media-type": "image/png", "id": "id\(index)"])
        } else {
            item.setAttributesAs(["href": "text/\(name)", "media-type": "application/xhtml+xml", "id": "id\(index)"])
        }
        return item
    }

    let img = manifestItem(withName: "20.png", index: 5)
    let text = manifestItem(withName: "20.html", index: 10)

    manifest.addChild(img)
    manifest.addChild(text)

    package.addChild(manifest)

    return package.xmlData(withOptions: Int(XMLNode.Options.nodePrettyPrint.rawValue))
}

let fm = FileManager.default


    version.name = "version"
    version.stringValue = "1.0"
    container.addAttribute(version)
    
    let namespace = XMLElement(kind: .attribute)
    namespace.name = "xmlns"
    namespace.stringValue = "urn:oasis:names:tc:opendocument:xmlns:container"
    container.addAttribute(namespace)
    
    let rootfiles = XMLElement(name: "rootfiles")
    let rootfile = XMLElement(kind: .element, options: .nodeCompactEmptyElement)
    rootfile.name = "rootfile"
