@Override
 public void endElement(String uri, String localName, String name) throws SAXException {
   super.endElement(uri, localName, name);
   if (secondElementName.equalsIgnoreCase(localName)) {
     --numLayersForRecording;
   }
 }
 @Override
 public void startElement(String uri, String localName, String name, Attributes atts)
     throws SAXException {
   super.startElement(uri, localName, name, atts);
   if (numLayers > 0) {
     if (secondElementName.equalsIgnoreCase(localName)) {
       numLayersForRecording = 1;
     } else if (numLayersForRecording > 0) {
       ++numLayersForRecording;
     }
   }
 }