title: Extract data from NamingEnumeration
body: <p>My application searches an LDAP server for people.</p>
  
  <pre><code>return ldapTemplate.search("", "(objectclass=person)", new AttributesMapper() {
        public Object mapFromAttributes(Attributes attrs) 
                                                       throws NamingException {
  
          return attrs.get("cn").getAll();
        }
      });
  </code></pre>
  
  <p>It returns list of <code>NamingEnumeration</code> object, which contains vectors in it. Each vector may contain one or more values.
  I can print person names by this code</p>
  
  <pre><code>for(NamingEnumeration ne : list){
    while (ne.hasMore()) {
        System.out.println("name is : " + ne.next().toString());
      }
    }
  </code></pre>
  
  <p>As my ldap search can contain mutiple values so that comes in vector inside <code>NamingEnumeration</code> object. How can I get multiple values out of it.</p>