void () { final XmlFile file = (XmlFile)PsiFileFactory.getInstance(getProject()).createFileFromText("test.xhtml", "<a>&nbsp;</a>"); final XmlTag tagB = file.getDocument().getRootTag(); assertEquals(tagB.getValue().getTextElements().length, 1); assertEquals(tagB.getValue().getTextElements()[0].getValue(), "\u00a0"); }