XMLEvent xmlEvent = xmlReader.nextEvent();
if (isStartOfHeader(xmlEvent))
{
while (xmlReader.hasNext())
{
xmlEvent = xmlReader.nextEvent();
if (isStartOfBinarySecurityToken(xmlEvent))
{
final StartElement bstElement = (StartElement) xmlEvent;
BinarySecurityToken bst = new BinarySecurityToken();
bst.setEncodingType(bstElement.getAttributeByName(encodingTypeQName).getValue());