Here you can find the source of isJAXBElement(Class
public static <BoundType> boolean isJAXBElement(Class<BoundType> declaredType, QName name, Class<?> scope, Object value)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; public class Main { public static <BoundType> boolean isJAXBElement(Class<BoundType> declaredType, QName name, Class<?> scope, Object value) {//w w w . ja v a 2 s.co m if (value == null) { return false; } else if (value instanceof JAXBElement) { final JAXBElement<?> element = (JAXBElement<?>) value; return element.getName().equals(name) && declaredType.isAssignableFrom(element.getDeclaredType()); } else { return false; } } }