code: public static Document toDocument(BaseComponent root, String... excludedProperties) {
          try {
              CWF2XML instance = new CWF2XML(excludedProperties);
              instance.toXML(root, instance.doc);
              return instance.doc;
          } catch (ParserConfigurationException e) {
              return null;
          }
      }
docs: Returns an XML document that mirrors the CWF component tree starting at the specified root.
  
  @param root BaseComponent whose subtree is to be traversed.
  @param excludedProperties An optional list of properties that should be excluded from the
  output. These may either be the property name (e.g., "uuid") or a property name
  qualified by a component name (e.g., "window.uuid"). Optionally, an entry may be
  followed by an "=" and a value to exclude matches with a specific value. Note that
  "innerAttrs" and "outerAttrs" are always excluded.
  @return An XML document that represents the component subtree.