code: public void transform(XmlNode node, StringBuilder builder) {
          switch (node.getType()) {
              case XmlNode.ELEMENT_NODE: {
                  builder.append("<");
                  builder.append(node.getName());
                  for (XmlNode attribute : node.getAttributes().values()) {
                      transform(attribute, builder);
                  }
                  builder.append(">");
                  for (XmlNode child : node.getChildren()) {
                      transform(child, builder);
                  }
                  builder.append("</");
                  builder.append(node.getName());
                  builder.append(">");
              }
                  break;
              case XmlNode.ATTRIBUTE_NODE: {
                  builder.append(" ");
                  builder.append(node.getName());
                  builder.append("=\"");
                  builder.append(node.getValue());
                  builder.append("\"");
              }
                  break;
              case XmlNode.TEXT_NODE: {
                  builder.append(node.getValue());
              }
          }
      }
docs: Transforms the XML node into the string
  
  @param node
  the node to transform
  @param builder
  the string builder