anchor.diff:                                                                      | D d -> d.ToString()
                                                              )) "" d.Components)
   
  +///get component refs from a directory component hierarchy
  +let rec getComponentRefs (elements : WiXDirectoryComponent seq) = 
  +    let refs = elements
  +                |> Seq.choose (fun e -> 
  +                                match e with
  +                                | D d -> Some (d)
  +                                | _ -> None)
  +                |> Seq.map (fun d -> getComponentRefs d.Components)
  +                |> Seq.concat
  +    let cRefs = elements
  +                |> Seq.choose (fun e -> 
  +                                match e with
  +                                | C c -> Some c
  +                                | _ -> None)
  +                |> Seq.map (fun c -> c.ToComponentRef())
  +    Seq.append refs cRefs
  +    
  +
   /// Defaults for component
   let WiXComponentDefaults =
       {
  
positive.code:         Id = "ServiceControl"
          Name = "Service"
          Remove = Both
          Start = Both
          Stop = Both
          Wait = Yes
      }
  
negative.code:         Id : string
          Name: string
          Remove : InstallUninstall
          Start : InstallUninstall option
          Stop : InstallUninstall
          Wait : YesOrNo
      }
      member w.createAttributeList () =
          seq 
              {
                  yield ("Id", w.Id)
                  yield ("Name", w.Name)
                  yield ("Remove", w.Remove.ToString())
                  if w.Start.IsSome then yield ("Start", w.Start.Value.ToString())
                  yield ("Stop", w.Stop.ToString())
                  yield ("Wait", w.Wait.ToString())
              }
      override w.ToString() = 
          sprintf "<ServiceControl%s/>" 
              (Seq.fold(fun acc (key, value) -> acc + sprintf " %s=\"%s\"" key value) "" (w.createAttributeList()))             
  
  /// Defaults for service control element
  let WiXServiceControlDefaults =
  