title: How to create multi level xml file
body: <p>I have a trouble in finding info about creating a multi level tags in xml file
  for example i want next structure</p>
  
  <pre><code>&lt;UserCards&gt;
    &lt;UserCard userCardId="171"&gt;
     &lt;userName&gt;somename&lt;/userName&gt;
     &lt;userSurname&gt;somesurname&lt;/userSurname&gt;
     &lt;userAge&gt;24&lt;/userAge&gt;
     &lt;userAdress&gt;someadress&lt;/userAdress&gt;
     &lt;userPhone&gt;223334455&lt;/userPhone&gt;
       &lt;CurrentBooks&gt;
         &lt;booName&gt;someBookName&lt;/bookName&gt;
       &lt;/CurrentBooks&gt;
    &lt;/UserCard&gt;
  &lt;/UserCards&gt;
  </code></pre>
  
  <p>I can create simple one level xml but how can I add new one?</p>
  
  <pre><code> DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
                  DocumentBuilder docBulder = docFactory.newDocumentBuilder();
  
                  //root mainElement
                  Document doc = docBulder.newDocument();
                  Element rootElement = doc.createElement("UserCards");
                  doc.appendChild(rootElement);
  
                  //root Book
                  Element UserCard = doc.createElement("UserCard");
                  rootElement.appendChild(UserCard);
                  ...  
                  ...
                  //write in a XMLFile
                  TransformerFactory transformerFactory = TransformerFactory.newInstance();
                  Transformer transformer = transformerFactory.newTransformer();
                  DOMSource source = new DOMSource(doc);
                  StreamResult result = new StreamResult(new File("Test/UserCards.xml"));
  </code></pre>