public void deleteFirstElement(Document doc) { Element root = doc.getDocumentElement(); Element child = (Element)root.getFirstChild(); root.removeChild(child); }