for (int xP = 0; xP < elDocParts.size(); ++xP)
{ Element elDocPart = elDocParts.get(xP);
Elements elPartMeasures = elDocPart.getChildElements("measure");
for (int xM = 0; xM < elPartMeasures.size(); ++xM)
if (elPartMeasures.get(xM).getChildCount() < 1)
elDocPart.removeChild(xM);
}
// create the Document
Document xomDoc = new Document(root);
DocType docType = new DocType("score-partwise",
"-//Recordare//DTD MusicXML 1.1 Partwise//EN",