#| Interaction with xq
unit module XQ;

#| Format an xml string
sub format-xml(Str:D $input --> Str:D) is export {
    my $xq = run <xq>, :out, :in;
    # Inject the xml
    $xq.in.spurt: $input, :close;
    $xq.out.slurp: :close
}