diff --git a/xml/tests/testData/xml/deprecated.xsd b/xml/tests/testData/xml/deprecated.xsd
index db5f12446e8c..7c21590ef1d4 100644
--- a/xml/tests/testData/xml/deprecated.xsd
+++ b/xml/tests/testData/xml/deprecated.xsd
@@ -1,25 +1,25 @@
-
-
-
-
+
+
+
+
-
-
-
- Some doc
- deprecated
-
-
-
-
-
+
+
+
+ Some doc
+ deprecated
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/xml/xml-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlDeprecatedElementInspection.java b/xml/xml-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlDeprecatedElementInspection.java
index ffea24d90f57..a68879ff34ec 100644
--- a/xml/xml-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlDeprecatedElementInspection.java
+++ b/xml/xml-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlDeprecatedElementInspection.java
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.XmlElementVisitor;
import com.intellij.psi.meta.PsiMetaData;
import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
import com.intellij.xml.util.XmlUtil;
import org.intellij.lang.annotations.Language;
import org.jetbrains.annotations.NotNull;
@@ -59,7 +60,8 @@ public class XmlDeprecatedElementInspection extends XmlSuppressableInspectionToo
if (!(declaration instanceof XmlTag)) return false;
XmlComment comment = XmlUtil.findPreviousComment(declaration);
if (comment != null && pattern.matcher(comment.getCommentText().trim()).matches()) return true;
- return checkTag(((XmlTag)declaration).findFirstSubTag("annotation"), pattern);
+ XmlTag tag = (XmlTag)declaration;
+ return checkTag(ArrayUtil.getFirstElement(tag.findSubTags("annotation", tag.getNamespace())), pattern);
}
private static boolean checkTag(XmlTag tag, Pattern pattern) {