     }
     
     public class func readXML(bundle: NSBundle, filename: String, bundleResourceName: String? = nil) -> NSData {
-        
         var resourceBundle: NSBundle = bundle
         if let resourceName = bundleResourceName {
             let bundleURL = bundle.URLForResource(resourceName, withExtension: "bundle")

// - make these monadic? so that values can be replaced?
// - make these composable?

public class SpectraXMLMeshNode: SpectraXMLNode {
    public typealias NodeType = MDLMesh
    
    public func parse(container: Container, elem: XMLElement, options: [String : Any] = [:]) -> NodeType {
        return MDLMesh()
    }
}


                        return SpectraXMLObjectNode.copy(obj)
                        }.inObjectScope(.None)
                case .Mesh:
                    let meshNode = MeshNode()
                    meshNode.parse(container, elem: child, options: options)
                    let meshGen = container.resolve(MeshGenerator.self, name: meshNode.generator)!
                    let mesh = meshGen.generate(container, args: meshNode.args)
                    container.register(MDLMesh.self, name: key!) { _ in
                        // TODO: don't copy meshes?
                        return mesh
                    }.inObjectScope(.None)
                case .MeshGenerator:
                    let meshGenNode = MeshGeneratorNode()
                    meshGenNode.parseXML(container, elem: child, options: options)
                    let meshGen = meshGenNode.createGenerator(container, options: options)
                    container.register(MeshGenerator.self, name: key!) { _ in
                        return meshGen.copy(container)
                    }
