title: How to parse the data of xml of elements with same names using python
body: <p>Hi I have this xml and I want get the strings related with the Name and Type of each Branch element and the FullProductName string element ("Cisco Unified Computing System (Management Software) 3.0(1)c"). I am trying to do it with python using bs4. But I don't know how can I do it. </p>
  
  <p><strong>XML:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;cvrfdoc xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.icasi.org/CVRF/schema/cvrf/1.1"&gt;
    &lt;DocumentTitle&gt;Cisco Integrated Management Controller Remote Code Execution Vulnerability&lt;/DocumentTitle&gt;
    &lt;DocumentType&gt;Cisco Security Advisory&lt;/DocumentType&gt;
    &lt;DocumentPublisher Type="Vendor"&gt;
      &lt;ContactDetails&gt;Emergency Support:
  +1 877 228 7302 (toll-free within North America)
  +1 408 525 6532 (International direct-dial)
  Non-emergency Support:
  Email: psirt@cisco.com
  Support requests that are received via e-mail are typically acknowledged within 48 hours.&lt;/ContactDetails&gt;
      &lt;IssuingAuthority&gt;Cisco product security incident response is the responsibility of the Cisco Product Security Incident Response Team (PSIRT). The Cisco PSIRT is a dedicated, global team that manages the receipt, investigation, and public reporting of security vulnerability information that is related to Cisco products and networks. The on-call Cisco PSIRT works 24x7 with Cisco customers, independent security researchers, consultants, industry organizations, and other vendors to identify possible security issues with Cisco products and networks.
  More information can be found in Cisco Security Vulnerability Policy available at http://www.cisco.com/web/about/security/psirt/security_vulnerability_policy.html&lt;/IssuingAuthority&gt;
    &lt;/DocumentPublisher&gt;
    &lt;DocumentTracking&gt;
      &lt;Identification&gt;
        &lt;ID&gt;cisco-sa-20170419-cimc3&lt;/ID&gt;
      &lt;/Identification&gt;
      &lt;Status&gt;Final&lt;/Status&gt;
      &lt;Version&gt;1.2&lt;/Version&gt;
      &lt;RevisionHistory&gt;
        &lt;Revision&gt;
          &lt;Number&gt;1.0&lt;/Number&gt;
          &lt;Date&gt;2017-04-18T16:50:37&lt;/Date&gt;
          &lt;Description&gt;Initial public release.&lt;/Description&gt;
        &lt;/Revision&gt;
        &lt;Revision&gt;
          &lt;Number&gt;1.1&lt;/Number&gt;
          &lt;Date&gt;2017-05-22T17:55:14&lt;/Date&gt;
          &lt;Description&gt;Updated affected products.&lt;/Description&gt;
        &lt;/Revision&gt;
        &lt;Revision&gt;
          &lt;Number&gt;1.2&lt;/Number&gt;
          &lt;Date&gt;2017-05-31T20:33:19&lt;/Date&gt;
          &lt;Description&gt;Added vulnerable releases.&lt;/Description&gt;
        &lt;/Revision&gt;
      &lt;/RevisionHistory&gt;
      &lt;InitialReleaseDate&gt;2017-04-19T16:00:00&lt;/InitialReleaseDate&gt;
      &lt;CurrentReleaseDate&gt;2017-05-31T20:33:19&lt;/CurrentReleaseDate&gt;
      &lt;Generator&gt;
        &lt;Engine&gt;TVCE&lt;/Engine&gt;
      &lt;/Generator&gt;
    &lt;/DocumentTracking&gt;
    &lt;DocumentNotes&gt;
      &lt;Note Title="Summary" Type="General" Ordinal="1"&gt;A vulnerability in the web-based GUI of Cisco Integrated Management Controller (IMC) could allow an unauthenticated, remote attacker to perform unauthorized remote command execution on the affected device.
  
  The vulnerability exists because the affected software does not sufficiently sanitize specific values that are received as part of a user-supplied HTTP request. An attacker could exploit this vulnerability by sending a crafted HTTP request to the affected software. Successful exploitation could allow an unauthenticated attacker to execute system commands with root-level privileges.
  
  There are no workarounds that address this vulnerability.
  
  This advisory is available at the following link:
  https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170419-cimc3 ["https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170419-cimc3"]&lt;/Note&gt;
      &lt;Note Title="CVSS 3.0 Notice" Type="Other" Ordinal="2"&gt;Although CVRF version 1.1 does not support CVSS version 3, the CVSS score in this CVRF file is a CVSSv3 base and temporal score, as Cisco is now scoring vulnerabilities in CVSSv3.&lt;/Note&gt;
    &lt;/DocumentNotes&gt;
    &lt;DocumentReferences&gt;
      &lt;Reference Type="Self"&gt;
        &lt;URL&gt;https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170419-cimc3&lt;/URL&gt;
        &lt;Description&gt;Cisco Integrated Management Controller Remote Code Execution Vulnerability&lt;/Description&gt;
      &lt;/Reference&gt;
    &lt;/DocumentReferences&gt;
    &lt;ProductTree xmlns="http://www.icasi.org/CVRF/schema/prod/1.1"&gt;
      &lt;Branch Name="Cisco" Type="Vendor"&gt;
        &lt;Branch Name="Cisco Unified Computing System (Management Software)" Type="Product Name"&gt;
          &lt;Branch Name="3.0" Type="Product Version"&gt;
            &lt;Branch Name="(1)c" Type="Service Pack"&gt;
              &lt;FullProductName ProductID="CVRFPID-203522"&gt;Cisco Unified Computing System (Management Software) 3.0(1)c&lt;/FullProductName&gt;
            &lt;/Branch&gt;
          &lt;/Branch&gt;
        &lt;/Branch&gt;
      &lt;/Branch&gt;
    &lt;/ProductTree&gt;
    &lt;Vulnerability Ordinal="1" xmlns="http://www.icasi.org/CVRF/schema/vuln/1.1"&gt;
      &lt;Title&gt;Cisco Integrated Management Controller Remote Code Execution Vulnerability&lt;/Title&gt;
      &lt;ID SystemName="Cisco Bug ID"&gt;CSCvd14578&lt;/ID&gt;
      &lt;Notes&gt;
        &lt;Note Title="Summary" Type="Summary" Ordinal="1"&gt;A vulnerability in the web-based GUI of Cisco Integrated Management Controller (IMC) could allow an unauthenticated, remote attacker to perform unauthorized remote command execution on the affected device.
  
  
  
  The vulnerability exists because the affected software does not sufficiently sanitize specific values that are received as part of a user-supplied HTTP request. An attacker could exploit this vulnerability by sending a crafted HTTP request to the affected software. Successful exploitation could allow an unauthenticated attacker to execute system commands with root-level privileges.&lt;/Note&gt;
        &lt;Note Title="Cisco Bug IDs" Type="Other" Ordinal="3"&gt;CSCvd14578&lt;/Note&gt;
      &lt;/Notes&gt;
      &lt;CVE&gt;CVE-2017-6616&lt;/CVE&gt;
      &lt;ProductStatuses&gt;
        &lt;Status Type="Known Affected"&gt;
          &lt;ProductID&gt;CVRFPID-203522&lt;/ProductID&gt;
        &lt;/Status&gt;
      &lt;/ProductStatuses&gt;
      &lt;CVSSScoreSets&gt;
        &lt;ScoreSet&gt;
          &lt;BaseScore&gt;9.8&lt;/BaseScore&gt;
          &lt;Vector&gt;CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H&lt;/Vector&gt;
        &lt;/ScoreSet&gt;
      &lt;/CVSSScoreSets&gt;
      &lt;Remediations&gt;
        &lt;Remediation Type="Workaround"&gt;
          &lt;Description&gt;There are no workarounds that address this vulnerability.&lt;/Description&gt;
        &lt;/Remediation&gt;
      &lt;/Remediations&gt;
      &lt;References&gt;
        &lt;Reference Type="Self"&gt;
          &lt;URL&gt;https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20170419-cimc3&lt;/URL&gt;
          &lt;Description&gt;Cisco Integrated Management Controller Remote Code Execution Vulnerability&lt;/Description&gt;
        &lt;/Reference&gt;
      &lt;/References&gt;
    &lt;/Vulnerability&gt;
  &lt;/cvrfdoc&gt;
  </code></pre>
  
  <p><strong>Python:</strong></p>
  
  <pre><code>from bs4 import BeautifulSoup
  
  xmlData = open("test.xml")
  soup = BeautifulSoup(xmlData, "lxml")
  preoductTree = soup.producttree
  
  vendor = preoductTree.find_all("branch", attrs={"type": "Vendor"})
  </code></pre>
  
  <p>Any idea?</p>
  
  <p>Thank you in advance.</p>