void () { final XmlTag tag = XmlElementFactory.getInstance(getProject()).createTagFromText("<foo xmlns='aaa' xmlns:a='bbbb'/>"); final Object[] nsPrefixes = ArrayUtil.toObjectArray(tag.getLocalNamespaceDeclarations().keySet()); Arrays.sort(nsPrefixes); assertEquals(2, nsPrefixes.length); assertEquals("a",nsPrefixes[1]); assertEquals("",nsPrefixes[0]); }