def set_metadata(receipt, price=None, retailer=None, note=None):
    """Set XMP metadata."""
    if price:
        receipt.price = price
    if retailer:
        receipt.retailer = retailer
    if note:
        receipt.note = note
