void () { final XmlFile file = createXmlFile("<a><foo/><child-element/><child-element/></a>"); final DomFileElementImpl<MyElement> fileElement = getDomManager().getFileElement(file, MyElement.class, "a"); assertNull(fileElement.getParent()); assertSame(fileElement, DomUtil.getFileElement(fileElement)); final MyElement rootElement = fileElement.getRootElement(); assertSame(fileElement, rootElement.getParent()); assertSame(fileElement, DomUtil.getFileElement(rootElement)); assertParent(rootElement.getFoo(), rootElement); assertParent(rootElement.getChildElements().get(0), rootElement); assertParent(rootElement.getChildElements().get(1), rootElement); }