code: private void buildFilmListFlash() throws Exception {
          final NodeList subtitleData = doc.getElementsByTagName("p");
  
          for (int i = 0; i < subtitleData.getLength(); i++) {
              final Subtitle subtitle = new Subtitle();
  
              final Node subnode = subtitleData.item(i);
              if (subnode.hasAttributes()) {
                  // retrieve the begin and end attributes...
                  final NamedNodeMap attrMap = subnode.getAttributes();
                  final Node beginNode = attrMap.getNamedItem("begin");
                  final Node endNode = attrMap.getNamedItem("end");
                  if (beginNode != null && endNode != null) {
                      subtitle.begin = parseFlash(beginNode.getNodeValue());
                      subtitle.end = parseFlash(endNode.getNodeValue());
                      final StyledString textContent = new StyledString();
                      textContent.setColor(color); // sicher ist sicher
                      textContent.setText(subnode.getTextContent());
  
                      final Node col = attrMap.getNamedItem("tts:color");
                      if (col != null) {
                          textContent.setColor(col.getNodeValue());
                      } else {
                          final NodeList childNodes = subnode.getChildNodes();
                          for (int j = 0; j < childNodes.getLength(); j++) {
                              final Node node = childNodes.item(j);
                              if (node.getNodeName().equalsIgnoreCase("span")) {
                                  //retrieve the text and color information...
                                  final NamedNodeMap attr = node.getAttributes();
                                  final Node co = attr.getNamedItem("tts:color");
                                  textContent.setColor(co.getNodeValue());
                              }
                          }
                      }
                      subtitle.listOfStrings.add(textContent);
  
                  }
              }
              subtitleList.add(subtitle);
          }
      }
docs: Build the Subtitle objects from TTML content.