一部分的代码为
  public   void   toWrite(String   mytitle,String   mycontent)
  { 

Element   root=document.createElement( "trolleyId");   

document.appendChild(root);   
Element   title=document.createElement( "Title");   
title.appendChild(document.createTextNode(mytitle));   
root.appendChild(title);   
Element   content=document.createElement( "Content");   
content.appendChild(document.createTextNode(mycontent));   
root.appendChild(content);   }   首先trolleyId节点里面有个id属性,生成xml后应为<trolleyId id="1"></trolleyid>,怎么弄
其次要让生成的这些个节点该换行的换行,该缩进的缩进,怎么弄,求解,希望个为大侠指点一下小弟,不胜感激