/src/main/java/org/htmlunit/util/XmlUtils.java
final DocumentType documentType = child.getOwnerDocument ( ) .getDoctype ( ) ;
public static void appendChild(final SgmlPage page, final DomNode parent, final Node child, final boolean handleXHTMLAsHTML) { appendChild(page, parent, child, handleXHTMLAsHTML, null); } public static void appendChild(final SgmlPage page, final DomNode parent, final Node child, final boolean handleXHTMLAsHTML, final Map<Integer, List<String>> attributesOrderMap) { <extra_id_0> if (documentType != null && page instanceof XmlPage) { final DomDocumentType domDoctype = new DomDocumentType( page, documentType.getName(), documentType.getPublicId(), documentType.getSystemId()); ((XmlPage) page).setDocumentType(domDoctype); } final DomNode childXml = createFrom(page, child, handleXHTMLAsHTML, attributesOrderMap);