private void addUIElement(CustomTreeNode elementNode, Element element) {
String elementName = "element";
if (element.isValue()) {
elementName = "valueElement";
}
CustomTreeNode tnb = new CustomTreeNode(elementName, element.getName(), false);
tnb.setContent(new ViewElement(element));
elementNode.getChildren().add(tnb);
tnb.setParent(elementNode);
if (!(element.isValue())) {
List attributes = element.getAttributes();
Iterator attrIt = attributes.iterator();
while(attrIt.hasNext()) {
Attribute currentAttr = (Attribute) attrIt.next();
CustomTreeNode attributeTreeNode = new CustomTreeNode("attribute", currentAttr.getName(), false);
attributeTreeNode.setContent(currentAttr);
attributeTreeNode.setParent(tnb);
tnb.getChildren().add(attributeTreeNode);
}
List childElements = element.getElements();
Iterator elementsIt = childElements.iterator();