String elementName = StaxParserUtil.getStartElementName(startElement);
if (elementName.equalsIgnoreCase(WSPolicyConstants.APPLIES_TO)) {
// Get the AppliesTo element
startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
AppliesTo appliesTo = new AppliesTo();
// Now we do not do anything to the applies to element. We go further
startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
QName qname = startElement.getName();
ParserNamespaceSupport parser = ParserController.get(qname);
if (parser == null)
throw new RuntimeException(ErrorCodes.UNKNOWN_TAG + qname);
Object parsedObject = parser.parse(xmlEventReader);
appliesTo.addAny(parsedObject);
EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
StaxParserUtil.validate(endElement, WSPolicyConstants.APPLIES_TO);
return appliesTo;
}