public static SOAPElement getRequiredElement(SOAPElement element, QName requiredQName, String context)
{
List<Element> childElements = DOMUtils.getChildElementsAsList(element, requiredQName);
if (childElements.size() < 1)
throw new RMException(
"Required " + requiredQName + " element not found in " + context + " element");
if (childElements.size() > 1)
throw new RMException(
"Only one " + requiredQName + " element can be present in " + context + " element");
return (SOAPElement)childElements.get(0);
}