<iterator-tree description="main query">
  <FLWORIterator>
    <LetVariable name="auction" materialize="true">
      <FnDocIterator>
        <SingletonIterator value="xs:string(auction.xml)"/>
      </FnDocIterator>
    </LetVariable>
    <LetVariable name="$$opt_temp_0" materialize="true">
      <HoistIterator>
        <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,closed_auctions)" typename="*" nill-allowed="false">
          <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,site)" typename="*" nill-allowed="false">
            <LetVarIterator varname="auction"/>
          </ChildAxisIterator>
        </ChildAxisIterator>
      </HoistIterator>
    </LetVariable>
    <ForVariable name="p">
      <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,person)" typename="*" nill-allowed="false">
        <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,people)" typename="*" nill-allowed="false">
          <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,site)" typename="*" nill-allowed="false">
            <LetVarIterator varname="auction"/>
          </ChildAxisIterator>
        </ChildAxisIterator>
      </ChildAxisIterator>
    </ForVariable>
    <LetVariable name="$$opt_temp_2" materialize="true">
      <HoistIterator>
        <FnDataIterator>
          <ChildAxisIterator test-kind="match_text_test" qname="*" typename="*" nill-allowed="false">
            <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,name)" typename="*" nill-allowed="false">
              <ForVarIterator varname="p"/>
            </ChildAxisIterator>
          </ChildAxisIterator>
        </FnDataIterator>
      </HoistIterator>
    </LetVariable>
    <LetVariable name="$$opt_temp_1" materialize="true">
      <HoistIterator>
        <FnDataIterator>
          <AttributeAxisIterator test-kind="match_name_test" qname="xs:QName(,,id)" typename="*" nill-allowed="false">
            <ForVarIterator varname="p"/>
          </AttributeAxisIterator>
        </FnDataIterator>
      </HoistIterator>
    </LetVariable>
    <ForVariable name="a">
      <UnhoistIterator>
        <LetVarIterator varname="$$opt_temp_0"/>
      </UnhoistIterator>
    </ForVariable>
    <ForVariable name="t">
      <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,closed_auction)" typename="*" nill-allowed="false">
        <ForVarIterator varname="a"/>
      </ChildAxisIterator>
    </ForVariable>
    <WhereClause>
      <FnBooleanIterator>
        <TypedValueCompareIterator_STRING>
          <PromoteIterator type="xs:anyAtomicType">
            <FnDataIterator>
              <AttributeAxisIterator test-kind="match_name_test" qname="xs:QName(,,person)" typename="*" nill-allowed="false">
                <ChildAxisIterator test-kind="match_name_test" qname="xs:QName(,,buyer)" typename="*" nill-allowed="false">
                  <ForVarIterator varname="t"/>
                </ChildAxisIterator>
              </AttributeAxisIterator>
            </FnDataIterator>
          </PromoteIterator>
          <UnhoistIterator>
            <LetVarIterator varname="$$opt_temp_1"/>
          </UnhoistIterator>
        </TypedValueCompareIterator_STRING>
      </FnBooleanIterator>
    </WhereClause>
    <ReturnClause>
      <ElementIterator>
        <SingletonIterator value="xs:QName(,,item)"/>
        <AttributeIterator qname="xs:QName(,,person)">
          <EnclosedIterator attr_cont="true">
            <UnhoistIterator>
              <LetVarIterator varname="$$opt_temp_2"/>
            </UnhoistIterator>
          </EnclosedIterator>
        </AttributeIterator>
        <EnclosedIterator attr_cont="false">
          <ForVarIterator varname="t"/>
        </EnclosedIterator>
      </ElementIterator>
    </ReturnClause>
  </FLWORIterator>
</iterator-tree>
