code: def _parse_structured_metadata(obj, xml):
      
      for metadata in xml.xpath("cpt:structured-metadata/*", namespaces=XPATH_NAMESPACES):
          tag = metadata.tag
          if "{" in tag:
              ns, tag = tuple(tag.split("}"))
              tag = URIRef(ns[1:]+tag)
              s_m = str(metadata)
              if s_m.startswith("urn:") or s_m.startswith("http:") or s_m.startswith("https:") or s_m.startswith("hdl:"):
                  obj.metadata.add(
                      tag,
                      URIRef(metadata)
                  )
              elif '{http://www.w3.org/XML/1998/namespace}lang' in metadata.attrib:
                  obj.metadata.add(
                      tag,
                      s_m,
                      lang=metadata.attrib['{http://www.w3.org/XML/1998/namespace}lang']
                  )
              else:
                  if "{http://www.w3.org/1999/02/22-rdf-syntax-ns#}datatype" in metadata.attrib:
                      datatype = metadata.attrib["{http://www.w3.org/1999/02/22-rdf-syntax-ns#}datatype"]
                      if not datatype.startswith("http") and ":" in datatype:
                          datatype = expand_namespace(metadata.nsmap, datatype)
                      obj.metadata.add(tag, Literal(s_m, datatype=URIRef(datatype)))
                  elif isinstance(metadata, IntElement):
                      obj.metadata.add(tag, Literal(int(metadata), datatype=XSD.integer))
                  elif isinstance(metadata, FloatElement):
                      obj.metadata.add(tag, Literal(float(metadata), datatype=XSD.float))
                  else:
                      obj.metadata.add(tag, s_m)
docs: Parse an XML object for structured metadata
  
      :param obj: Object whose metadata are parsed
      :param xml: XML that needs to be parsed