class Lutaml::Xml::Schema::Xsd::Sequence

def child_elements(array = [])

Walk the sequence recursively and collect contained element nodes.
def child_elements(array = [])
  resolved_element_order&.each do |child|
    if child.is_a?(Element)
      array << child
    elsif child.is_a?(Group) || child.is_a?(Sequence) || child.is_a?(Choice) || child.is_a?(ComplexType)
      child.child_elements(array)
    end
  end
  array
end

def find_elements_used(element_name)

nested branch.
Check whether the sequence references a given element name in any
def find_elements_used(element_name)
  resolved_element_order&.any? do |child|
    if child.is_a?(Element)
      reference_matches?(element_name, child.ref || child.name)
    elsif child.is_a?(Group) || child.is_a?(Sequence) || child.is_a?(Choice) || child.is_a?(ComplexType)
      child.find_elements_used(element_name)
    end
  end || false
end