private static ElementStart createElementStart(String type, Attributes attrs) {
ElementStart elementStart = MessageFactoryHelper.createDocumentElementStart();
elementStart.setType(type);
for (Map.Entry<String, String> attribute : attrs.entrySet()) {
elementStart.addAttribute(
createKeyValuePair(attribute.getKey(), attribute.getValue()));
}
return elementStart;
}