code: func XMLToText(r io.Reader, breaks []string, skip []string, strict bool) (string, error) {
  	var result string
  
  	dec := xml.NewDecoder(r)
  	dec.Strict = strict
  	for {
  		t, err := dec.Token()
  		if err != nil {
  			if err == io.EOF {
  				break
  			}
  			return "", err
  		}
  
  		switch v := t.(type) {
  		case xml.CharData:
  			result += string(v)
  		case xml.StartElement:
  			for _, breakElement := range breaks {
  				if v.Name.Local == breakElement {
  					result += "\n"
  				}
  			}
  			for _, skipElement := range skip {
  				if v.Name.Local == skipElement {
  					depth := 1
  					for {
  						t, err := dec.Token()
  						if err != nil {
  							// An io.EOF here is actually an error.
  							return "", err
  						}
  
  						switch t.(type) {
  						case xml.StartElement:
  							depth++
  						case xml.EndElement:
  							depth--
  						}
  
  						if depth == 0 {
  							break
  						}
  					}
  				}
  			}
  		}
  	}
  	return result, nil
  }
docs: // XMLToText converts XML to plain text given how to treat elements.