src/main/java/j2html/TagCreator.java
public static String document(ContainerTag htmlTag) {
        if (htmlTag.getTagName().equals("html")) {
            return document().render() + htmlTag.render();
        }
        throw new IllegalArgumentException("Only HTML-tag can follow document declaration");
    }
public static String document(ContainerTag htmlTag) {
        if (htmlTag.getTagName().equals("html")) {
            return document().render() + htmlTag.render();
        }
        throw new IllegalArgumentException("Only HTML-tag can follow document declaration");
    }
public static String document ( ContainerTag htmlTag ) { if ( htmlTag . getTagName ( ) . equals ( "html" ) ) { return document ( ) . render ( ) + htmlTag . render ( ) ; } throw new IllegalArgumentException ( "Only HTML-tag can follow document declaration" ) ; }
Return a complete html document string

@param htmlTag the html content of a website
@return document declaration and rendered html content
Return a complete html document string