title: I want to remove a line an xml file after writing in it
body: <p>I have this code ,that parse a file xml ,I want ,after writing in this file,to remove the second line ,but I don't know how to do it?</p>
  
  <p><strong>this is my code:</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>File file = new File("C:\\Documents and Settings\\My Documents\\test.xml");
  
  dos = new DataOutputStream(new FileOutputStream(file));
  dos.writeBytes(var2);  //after writing I want to remove the second line
  
  try {
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(file);
      doc.getDocumentElement().normalize();
      System.out.println("Root element " + doc.getDocumentElement().getNodeName());
      NodeList nodeLst = doc.getElementsByTagName("step");
      System.out.println("Information of all steps");
  
      for (int s = 0; s &lt; nodeLst.getLength(); s++) {
          Node fstNode = nodeLst.item(s);
  
          if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
              Element fstElmnt = (Element) fstNode;
              System.out.println("oooo"+fstElmnt.toString());
              // NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("step");
              String fst = fstElmnt.getAttribute("name");
              System.out.println("name : "+fst); //display steps un step
          }
      }
  }
  catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>I want to remove a node that generate an error when I try to parse the file ,so I should remove this node before trying to parse the file
  </code></pre>