title: Test if children tag exists in beautifulsoup
body: <p>i have an XML file with an defined structure but different number of tags, like</p>
  
  <p>file1.xml:</p>
  
  <pre><code>&lt;document&gt;
    &lt;subDoc&gt;
      &lt;id&gt;1&lt;/id&gt;
      &lt;myId&gt;1&lt;/myId&gt;
    &lt;/subDoc&gt;
  &lt;/document&gt;
  </code></pre>
  
  <p>file2.xml:</p>
  
  <pre><code>&lt;document&gt;
    &lt;subDoc&gt;
      &lt;id&gt;2&lt;/id&gt;
    &lt;/subDoc&gt;
  &lt;/document&gt;
  </code></pre>
  
  <p>Now i like to check, if the tag <code>myId</code> exits. So i did the following:</p>
  
  <pre><code>data = open("file1.xml",'r').read()
  xml = BeautifulSoup(data)
  
  hasAttrBs = xml.document.subdoc.has_attr('myID')
  hasAttrPy = hasattr(xml.document.subdoc,'myID')
  hasType = type(xml.document.subdoc.myid)
  </code></pre>
  
  <p>The result is for
  file1.xml: </p>
  
  <pre><code>hasAttrBs -&gt; False
  hasAttrPy -&gt; True
  hasType -&gt;   &lt;class 'bs4.element.Tag'&gt;
  </code></pre>
  
  <p>file2.xml: </p>
  
  <pre><code>hasAttrBs -&gt; False
  hasAttrPy -&gt; True
  hasType -&gt; &lt;type 'NoneType'&gt;
  </code></pre>
  
  <p>Okay, <code>&lt;myId&gt;</code> is not an attribute of <code>&lt;subdoc&gt;</code>.</p>
  
  <p>But how i can test, if an sub-tag exists?</p>
  
  <p>//Edit: By the way:  I'm don't really like to iterate trough the whole subdoc, because that will be very slow. I hope to find an way where I can direct address/ask that element.</p>