protected Tag convertTag(Tag tag, Namespace namespace, String localName) {
Location location = tag.getLocation();
String ns = namespace.uri;
String qName = namespace.name() + ":" + localName;
TagAttributes attributes = convertAttributes(tag.getAttributes());
Tag converted = new Tag(location, ns, localName, qName, attributes);
for (TagAttribute tagAttribute : attributes.getAll()) {
// set the correct tag
tagAttribute.setTag(converted);
}
return converted;