anchor.diff:  %%%----------------------------------------------------------------------
   %%% File    : xml.erl
   %%% Author  : Alexey Shchepin <alexey@process-one.net>
  -%%% Purpose : XML utils
  +%%% Purpose : XML utils for parsing, matching, processing XML
   %%% Created : 20 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
   %%%
   %%%
  
positive.code: get_subtag_with_xmlns1([], _, _) ->
      false.
  
  %%
  -spec(get_subtag_cdata/2 ::
  (
  
negative.code:     -> xmlel() | false
  ).
  
  get_subtag1( [El | Els], Name) ->
      case El of
        #xmlel{name = Name} -> El;
        _ -> get_subtag1(Els, Name)
      end;
  get_subtag1([], _) -> false.
  
  -spec(get_subtags/2 ::
  (
    Xmlel :: xmlel(),
    Name  :: binary())
      -> [xmlel()]
  ).
  
  get_subtags(#xmlel{children = Els}, Name) ->
      get_subtags1(Els, Name, []).
  
  get_subtags1([], _Name, Acc) ->
      lists:reverse(Acc);
  get_subtags1([El | Els], Name, Acc) ->
      case El of
          #xmlel{name = Name} -> get_subtags1(Els, Name, [El|Acc]);
          _ -> get_subtags1(Els, Name, Acc)
      end.
  
  %%
  -spec(get_subtag_with_xmlns/3 ::
  