Here you can find the source of extract(final List
public static Object extract(final List<Object> anyList, final Class classType, final QName eltName)
//package com.java2s; /*// w ww .jav a 2s . c o m * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; public class Main { public static Object extract(final List<Object> anyList, final Class classType, final QName eltName) { for (final Object any : anyList) { if (any instanceof JAXBElement) { final JAXBElement elt = (JAXBElement) any; if ((classType != null && classType.equals(elt.getDeclaredType())) && (eltName != null && eltName.equals(elt.getName()))) { return elt.getValue(); } } } return null; } }