title: ExpatError: junk after document element
body: <p>I really don't know, what the Problem is? I get the following error:</p>
  
  <pre><code>File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString
  parser.Parse(string, True)
  ExpatError: junk after document element: line 5, column 0
  </code></pre>
  
  <p>I DONT SEE NO JUNK! Any help? I'm getting crazy......</p>
  
  <pre><code>text = """&lt;questionaire&gt;
  &lt;question&gt;
      &lt;questiontext&gt;Question1&lt;/questiontext&gt;
      &lt;answer&gt;Your Answer: 99&lt;/answer&gt;
  &lt;/question&gt;
  &lt;question&gt;
      &lt;questiontext&gt;Question2&lt;/questiontext&gt;
      &lt;answer&gt;Your Answer: 64&lt;/answer&gt;
  &lt;/question&gt;
  &lt;question&gt;
      &lt;questiontext&gt;Question3&lt;/questiontext&gt;
      &lt;answer&gt;Your Answer: 46&lt;/answer&gt;
  &lt;/question&gt;
  &lt;question&gt;
      &lt;questiontext&gt;Bitte geben&lt;/questiontext&gt;
      &lt;answer&gt;Your Answer: 544&lt;/answer&gt;
      &lt;answer&gt;Your Answer: 943&lt;/answer&gt;
  &lt;/question&gt;
  &lt;/questionaire&gt;"""
  
  cleandata = text.split('&lt;questionaire&gt;')
  cleandatastring= "".join(cleandata)
  stripped = cleandatastring.strip()
  planhtml = stripped.split('&lt;/questionaire&gt;')[0]
  clean= planhtml.strip()
  
  
  from xml.dom import minidom
  
  doc = minidom.parseString(clean)
  for question in doc.getElementsByTagName('question'):
      for answer in question.getElementsByTagName('answer'):
          if answer.childNodes[0].nodeValue.strip() == 'Your Answer: 99':
              question.parentNode.removeChild(question)
  
  print doc.toxml() 
  </code></pre>
  
  <p>Thanx!</p>