code: public void parse(String xmlInput, boolean strict) throws ParseException {
  
  		if (xmlInput == null) {
  			throw new IllegalArgumentException("input can not be null");
  		}
  		ArrayList splitContents = split(xmlInput, interpreteAsXHTML, true);
  
  
  		build(splitContents, interpreteAsXHTML);
  
  
  		int nodeCount = 0;
  		ArrayList contentsToRemove = new ArrayList();
  		Iterator i = contents.iterator();
  		while (i.hasNext()) {
  			Object element = i.next();
  			if (element instanceof Node) {
  				nodeCount++;
  			} else if (element instanceof Tag) {
  				Tag tag = (Tag) element;
  				if (!(tag.getType() == Tag.INSTRUCTION_TAG || tag.getType() == Tag.COMMENT_TAG)) {
  					throw new ParseException("document contains invalid element: " + StringSupport.condenseWhitespace(StringSupport.trim(element.toString(), 20, "...")));
  				}
  			} else {
  				if (element.toString().trim().length() > 0) {
  					//TODO if strict throw new ParseException("document contains invalid element: " + StringSupport.condenseWhitespace(StringSupport.trim(element.toString(), 20, "...")));
  					contentsToRemove.add(element);
  				}
  			}
  			if (nodeCount > 1) {
  				throw new ParseException("document contains more than 1 node: " + StringSupport.condenseWhitespace(StringSupport.trim(element.toString(), 20, "...")));
  			}
  		}
  		i = contentsToRemove.iterator();
  		while (i.hasNext()) {
  			contents.remove(i.next());
  		}
  	}
docs: Loads the contents from an XML text
  A sanity check is performed, which is not too strict:
  A valid document must contain one node exactly
  and may furthermore contain instruction- and comment-tags.
  
  @param xmlInput
  @throws ParseException if the XML document can not be parsed