     }
     
     /// Product reference.
-    public var productReference: PBXObjectReference?
+    var productReference: PBXObjectReference?
+    
+    /// Product.
+    public var product: XCSwiftPackageProductDependency? {
+        get {
+            return productReference?.getObject()
+        }
+        set {
+            self.productReference = newValue?.reference
+        }
+    }
 
     /// Element settings
     public var settings: [String: Any]?

        let container = try decoder.container(keyedBy: CodingKeys.self)
        if let fileRefString: String = try container.decodeIfPresent(.fileRef) {
            fileReference = objectReferenceRepository.getOrCreate(reference: fileRefString, objects: objects)
        }
        settings = try container.decodeIfPresent([String: Any].self, forKey: .settings)
        try super.init(from: decoder)

            let fileElement: PBXFileElement? = fileReference.getObject()
            dictionary["fileRef"] = .string(CommentedString(fileReference.value, comment: fileElement?.fileName()))
        }
        if let product = buildFile.product {
            dictionary["productRef"] = .string(.init(product.reference.value, comment: product.productName))
        }
        if let settings = buildFile.settings {
            dictionary["settings"] = settings.plist()
        }
