changed everywhere bracket to Tag
replaced numMatch by numXmlTag and tagNumber by xmlTagNumber
renamings: calcInnerTextScope=>calcOuterXml, B=>outerXmlText, A=>innerXmlText
simplified forLoop