class_docstr: Class for writing annotations in VOC format.
  
  See :ref:`this page <VOCDetectionDataset-export>` for format details.
class_docstr_tok: ["Class","for","writing","annotations","in","VOC","format",".","See",":","ref",":","`","this","page","<","VOCDetectionDataset-export",">","`","for","format","details","."]
docstr: Writes the annotations to disk.
  
  Args:
      annotation: a :class:`VOCAnnotation` instance
      xml_path: the path to write the annotation XML file
docstr_tok: ["Writes","the","annotations","to","disk",".","Args",":","annotation",":","a",":","class",":","`","VOCAnnotation","`","instance","xml_path",":","the","path","to","write","the","annotation","XML","file"]
code: def write(self, annotation, xml_path):
      """Writes the annotations to disk.
  
      Args:
          annotation: a :class:`VOCAnnotation` instance
          xml_path: the path to write the annotation XML file
      """
      if annotation.metadata is not None:
          metadata = annotation.metadata
      else:
          metadata = fom.ImageMetadata()
  
      xml_str = self.template.render(
          {
              "path": annotation.path,
              "filename": annotation.filename,
              "folder": annotation.folder,
              "width": metadata.width or "",
              "height": metadata.height or "",
              "depth": metadata.num_channels or "",
              "database": None,
              "segmented": annotation.segmented,
              "objects": annotation.objects,
          }
      )
      etau.write_file(xml_str, xml_path)
  
imports: import logging
  import os
  import jinja2
  import eta.core.utils
  import fiftyone.constants
  import fiftyone.core.labels
  import fiftyone.core.metadata
  import fiftyone.core.storage
  import fiftyone.core.utils
  import fiftyone.utils.data
label_desc: Use image node_id 2 for calling the VOCAnnotationWriter obj's underlying member method code with example usage: obj.write(annotation, xml_path) without return types