void () { final XmlTag tag = XmlElementFactory.getInstance(getProject()).createXHTMLTagFromText("<a> <b/> </a>"); ApplicationManager.getApplication().runWriteAction(() -> tag.findFirstSubTag("b").delete()); assertEquals("<a> </a>", tag.getText()); }