class_docstr: Represent a GCS Object, including all its revisions.
class_docstr_tok: ["Represent","a","GCS","Object",",","including","all","its","revisions","."]
docstr: Implement the insert operation using the XML API.
  
  :param gcs_url:str the root URL for the fake GCS service.
  :param request:flask.Request the contents of the HTTP request.
  :return: the newly created object version.
  :rtype: GcsObjectVersion
docstr_tok: ["Implement","the","insert","operation","using","the","XML","API",".",":","param","gcs_url",":","str","the","root","URL","for","the","fake","GCS","service",".",":","param","request",":","flask.Request","the","contents","of","the","HTTP","request",".",":","return",":","the","newly","created","object","version",".",":","rtype",":","GcsObjectVersion"]
code: def insert_xml(self, gcs_url, request):
      """Implement the insert operation using the XML API.
  
      :param gcs_url:str the root URL for the fake GCS service.
      :param request:flask.Request the contents of the HTTP request.
      :return: the newly created object version.
      :rtype: GcsObjectVersion
      """
      media = testbench_utils.extract_media(request)
      self.generation_generator += 1
      goog_hash = request.headers.get("x-goog-hash")
      md5hash = None
      crc32c = None
      if goog_hash is not None:
          for hash in goog_hash.split(","):
              if hash.startswith("md5="):
                  md5hash = hash[4:]
              if hash.startswith("crc32c="):
                  crc32c = hash[7:]
      revision = GcsObjectVersion(
          gcs_url,
          self.bucket_name,
          self.name,
          self.generation_generator,
          request,
          media,
      )
      meta = revision.metadata.setdefault("metadata", {})
      meta["x_testbench_upload"] = "xml"
      if md5hash is not None:
          meta["x_testbench_md5"] = md5hash
          revision.update_from_metadata({"md5Hash": md5hash})
      if crc32c is not None:
          meta["x_testbench_crc32c"] = crc32c
          revision.update_from_metadata({"crc32c": crc32c})
      self._insert_revision(revision)
      return revision
  
imports: import base64
  import crc32c
  import error_response
  import hashlib
  import json
  import struct
  import testbench_utils
  import time
label_desc: Use image node_id 13 for calling the GcsObject obj's underlying member method code with example usage: obj.insert_xml(gcs_url, request) and returns: revision