title: JDOM2 Namespace with prefix 'uml' has not been declared
body: <p>I am trying to get an Element via the XPathExpression option from JDOM.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>public static Element getElement(Document doc)
  {
      XPathFactory xpfac = XPathFactory.instance();
      XPathExpression&lt;Element&gt; xp = xpfac.compile("//uml:Model/packagedElement[@name='Content']", Filters.element());
      return xp.evaluateFirst(doc);
  }
  </code></pre>
  
  <p>Sadly i get the following error:</p>
  
  <p>java.lang.IllegalArgumentException: Namespace with prefix 'uml' has not been declared.</p>
  
  <p>My document starts like this:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;xmi:XMI xmi:version='2.1' xmlns:uml='http://www.omg.org/spec/UML/20090901'...
  </code></pre>
  
  <p>So in my opinion the namespace is declared. If i check the xpath expression with a tool for the given document, the element is found.</p>
  
  <p>Thats how i created the document:</p>
  
  <pre><code>public static Document readXML(File file)
  {
      Document doc = null;
      try {
          doc = new SAXBuilder().build(file);
      } catch (JDOMException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
      return doc;
  }
  </code></pre>
  
  <p>So, wheres the error? How can the XpathExpression find the element "//uml:Model/packagedElement[@name='Content']" ?</p>
  
  <p>Best regards</p>