docs: @Pure
  	public static Document getDocumentFor(Node node) {
  		Node localnode = node;
  		while (localnode != null) {
  			if (localnode instanceof Document) {
  				return (Document) localnode;
  			}
  			localnode = localnode.getParentNode();
  		}
  		return null;
  	}