code: protected XmlElement findMatchedElementIn(Document document, org.dom4j.Element element) {
      org.dom4j.Attribute id = element.attribute("id");
      String idName = id.getName();
      String idValue = id.getValue();
      for (Element me : document.getRootElement().getElements()) {
        if (me instanceof XmlElement) {
          XmlElement xe = (XmlElement) me;
          for (Attribute ab : xe.getAttributes()) {
            if (StringUtils.equals(idName, ab.getName()) && StringUtils.equals(idValue, ab.getValue())) {
              return xe;
            }
          }
        }
      }
      return null;
    }
docs: 从MBG生成的DOM文档结构中找到与element代表同一节点的元素对象
  
  @param document generate xml dom tree
  @param element  The dom4j element
  @return The xml element correspond to dom4j element