code: private void appendNode(Node appendNode) {
          if (currentElement==null) {
              currentDocument.appendChild(appendNode);
          } else {
              currentElement.appendChild(appendNode);
          }
      }
docs: Append a node to the current document or the current element in the document
  @param appendNode