private void readRequirementElement(XMLStreamReader reader, XResourceBuilder<XResource> builder) throws XMLStreamException {
String namespace = reader.getAttributeValue(null, Attribute.NAMESPACE.toString());
Map<String, Object> atts = new HashMap<String, Object>();
Map<String, String> dirs = new HashMap<String, String>();
readAttributesAndDirectives(reader, atts, dirs);
try {
builder.addRequirement(namespace, atts, dirs);
} catch (RuntimeException ex) {
throw MESSAGES.cannotReadResourceElement(ex, reader.getLocation());
}
}