code: private List<Node> parseAsList(String body, String tagname) {
      	if (body == null) {
      		return Collections.<Node>emptyList();
      	}
      	
      	Document doc = doc(body);
      	
      	NodeList nl = null;
      	
      	if (tagname != null) {
      		nl = doc.getElementsByTagName(tagname);
      	} else {
      		nl = doc.getFirstChild().getChildNodes();
      	}
  
      	List<Node> rt = new ArrayList<Node>(nl.getLength());
      	
      	for (int i = 0; i < nl.getLength(); ++i) {
      		rt.add(nl.item(i));
      	}
      	
      	return rt;
      }
docs: for convenience