code: static void writeCursorAsset(CursorAsset asset, BufferedWriter writer) throws IOException {
          writer.write(XML_START_TAG);
          XMLUtils.writeXmlAttribute(ACTION, asset.getAction(), writer);
          XMLUtils.writeXmlAttribute(SRC, asset.getSrc(), writer);
          XMLUtils.writeXmlAttribute(SOUND_ENABLED, XMLUtils.xmlFromBoolean(asset.isSoundEnabled())
                  , writer);
  
          String soundSrc = asset.getSoundSrc();
          if (soundSrc != null) {
              XMLUtils.writeXmlAttribute(SOUND_SRC, soundSrc, writer);
          }
          XMLUtils.writeXmlAttribute(TYPE, asset.getAssetType().getValue(), writer);
          XMLUtils.writeXmlAttribute(ANIMATED, XMLUtils.xmlFromBoolean(asset.getAnimated()), writer);
  
          if (asset instanceof AnimatedCursorAsset) {
              AnimatedCursorAsset animatedCursorAsset = (AnimatedCursorAsset) asset;
              XMLUtils.writeXmlAttribute(DURATION, animatedCursorAsset.getAnimationDuration(),
                      writer);
          }
          if (asset instanceof MeshCursorAsset) {
              MeshCursorAsset meshAsset = (MeshCursorAsset) asset;
              XMLUtils.writeXmlAttribute(X, meshAsset.getX(), writer);
              XMLUtils.writeXmlAttribute(Y, meshAsset.getY(), writer);
          }
          writer.write(XMLUtils.ELEMENT_END);
      }
docs: TODO use XmlSerializer