code: def make_parser(stream_or_string):
      
  
      if isinstance(stream_or_string, six.string_types):
  
          # XXX: the pulldom.parseString() function doesn't seem to
          # like operating on unicode strings!
  
          return pulldom.parseString(str(stream_or_string))
  
      else:
  
          return pulldom.parse(stream_or_string)
docs: Create a xml.dom.pulldom parser.